This file contains 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
Future<Null> uploadFile(String filepath) async { | |
final String fileName = '${DateTime.now().millisecondsSinceEpoch}.jpg'; | |
final ByteData bytes = await rootBundle.load(filepath); | |
final Directory tempDir = Directory.systemTemp; | |
final File file = File('${tempDir.path}/$fileName'); | |
file.writeAsBytes(bytes.buffer.asInt8List(), mode: FileMode.write); | |
final StorageReference storageRef = | |
FirebaseStorage.instance.ref().child('eventImages/$fileName'); | |
final StorageUploadTask task = storageRef.putFile(file); |
This file contains 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
D:\PART_TIME_JOB\nutreat_demo>flutter run --verbose | |
[ +51 ms] executing: [D:\flutter-beta\flutter\] git rev-parse --abbrev-ref --symbolic @{u} | |
[ +163 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} | |
[ +4 ms] origin/dev | |
[ ] executing: [D:\flutter-beta\flutter\] git rev-parse --abbrev-ref HEAD | |
[ +90 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD | |
[ ] dev | |
[ ] executing: [D:\flutter-beta\flutter\] git ls-remote --get-url origin | |
[ +85 ms] Exit code 0 from: git ls-remote --get-url origin | |
[ +1 ms] https://github.com/flutter/flutter.git |
This file contains 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 { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
showPerformanceOverlay: true, |
This file contains 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'; | |
import 'package:graphql_flutter/graphql_flutter.dart'; | |
void main() { | |
WidgetsFlutterBinding.ensureInitialized(); | |
final HttpLink httpLink = HttpLink( | |
uri: 'https://countries.trevorblades.com/', | |
); | |
final ValueNotifier<GraphQLClient> client = ValueNotifier<GraphQLClient>( | |
GraphQLClient( |
This file contains 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 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 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_test/flutter_test.dart'; | |
class Counter { | |
int value = 0; | |
void increment() => value++; | |
void decrement() => value--; | |
} | |
void main() { |
This file contains 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
// This is a basic Flutter widget test. | |
// | |
// To perform an interaction with a widget in your test, use the WidgetTester | |
// utility in the flutter_test package. For example, you can send tap and scroll | |
// gestures. You can also use WidgetTester to find child widgets in the widget | |
// tree, read text, and verify that the values of widget properties are correct. | |
import 'package:counter_app/main.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_test/flutter_test.dart'; |
This file contains 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(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
// This widget is the root of your application. |
OlderNewer