flutter-dependencies
Update flutter dependencies in /.pub-cache
Disclaimer: By running the command below, have a really fast internet connection or be ready to lose one hour of productive hours. ( it will redownload every package every installed on your pc, and I mean each and all of the versions of each packages)~TSR flutter pub cache repair or delete /Users/xxxxxxx/development/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.8.2+3/ and run flutter … Read more
Do not use BuildContexts across async gaps
Don’t stock context directly into custom classes, and don’t use context after async if you’re not sure your widget is mounted. Do something like this: class MyCustomClass { const MyCustomClass(); Future<void> myAsyncMethod(BuildContext context, VoidCallback onSuccess) async { await Future.delayed(const Duration(seconds: 2)); onSuccess.call(); } } class MyWidget extends StatefulWidget { @override _MyWidgetState createState() => _MyWidgetState(); } … Read more
How to change status bar color in Flutter?
Update Flutter 2.0 (Recommended): On latest Flutter version, you should use: AppBar( systemOverlayStyle: SystemUiOverlayStyle( // Status bar color statusBarColor: Colors.red, // Status bar brightness (optional) statusBarIconBrightness: Brightness.dark, // For Android (dark icons) statusBarBrightness: Brightness.light, // For iOS (dark icons) ), ) Only Android (more flexibility): import ‘package:flutter/services.dart’; void main() { SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( systemNavigationBarColor: Colors.blue, // navigation … Read more