This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ```dart | |
| import 'package:mime/mime.dart'; //add mime to pubspec.yaml | |
| import 'package:uuid/uuid.dart'; //add uuid to pubspec.yaml | |
| import 'package:firebase_storage/firebase_storage.dart'; //add firebase storage to pubspec.yaml | |
| import 'package:path/path.dart'; //add path to pubspec.yaml | |
| final firebaseStorage = FirebaseStorage.instance; | |
| Future uploadFile({required File file}) async { | |
| const uuid = Uuid(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| const AWS = require('aws-sdk'); | |
| AWS.config.update({ | |
| secretAccessKey: process.env.secretAccessKey, | |
| accessKeyId: process.env.accessKeyId, | |
| region: process.env.region | |
| }); | |
| const sendSms = function (event, context, callback) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| @override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def localProperties = new Properties() | |
| def localPropertiesFile = rootProject.file('local.properties') | |
| if (localPropertiesFile.exists()) { | |
| localPropertiesFile.withReader('UTF-8') { reader -> | |
| localProperties.load(reader) | |
| } | |
| } | |
| def keystorePropertiesFile = rootProject.file("keystore.properties") //signing key | |
| def keystoreProperties = new Properties() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express'); | |
| const router = express.Router(); | |
| const upload = require('../services/uploder_service'); | |
| const singleUpload = upload.single('image'); | |
| router.post('/image-upload', function(req, res) { | |
| singleUpload(req, res, function(err) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ```dart | |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //add to pubspec: material_segmented_control: ^2.0.9 | |
| import 'package:flutter/cupertino.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/rendering.dart'; | |
| import 'package:flutter_icons/flutter_icons.dart'; | |
| import 'package:material_segmented_control/material_segmented_control.dart'; | |
| class TeamDashboardPage extends StatefulWidget { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ```dart | |
| import 'package:flutter/material.dart'; | |
| Color fromHex(String hexString) { | |
| final buffer = StringBuffer(); | |
| if (hexString.length == 6 || hexString.length == 7) buffer.write('ff'); | |
| buffer.write(hexString.replaceFirst('#', '')); | |
| return Color(int.parse(buffer.toString(), radix: 16)); | |
| } | |
| ```dart |