Using context.mounted in Flutter 3.7
1 min read
Since Flutter 3.7, BuildContext has a mounted property that we can check after an asynchronous gap. Here's how to use it.
Since Flutter 3.7, BuildContext has a mounted property that we can check after an asynchronous gap. Here's how to use it.
An overview of what Dart Fix can do for you, along with some useful VSCode productivity tips and settings for Flutter app development.
How to style an ElevatedButton in Flutter, including reusing the same style across all buttons with ThemeData.
Flutter apps built for macOS need a client network entitlement in order to make network requests. Here's how to configure it.
DartPad makes it easy to share your Dart & Flutter samples using GitHub gists, and you can even embed them on your website. Here's how.
When a test waits for a stream value that is never emitted, it will timeout after 30 seconds (by default). Here's how to make it fail fast with a custom timeout.
Since Dart 2.17, you can initialize parameters of the super class with a new shorthand syntax. Here's how.
Since Dart 2.17, we can add members and additional methods when declaring an enum. Here's how.
When writing tests for functions that throw, we should not invoke them directly, but rather pass them as arguments using a tear-off.
Ever needed to update a value if a given key already exists, or set it if it doesn't? Here's how to use the Map.update() method to solve this.
If you have many StateNotifier subclasses, using try/catch can be tedious. With AsyncValue.guard you get the same result with less boilerplate.
A useful tip to write more performant code when using SizedBox as a gap between widgets inside a Row or Column layout.
How to use the precompiled Firestore iOS SDKs to speed-up Xcode builds on your Flutter apps.
The faker package lets you generate addresses, names, food, dates, sports... you name it! Here's how to use it.
In Flutter you can use DecoratedBox to set a lot of decoration/styling options to your widgets. Here's how.
Many Material widgets such as InkWell, ElevatedButton, and ListTile show a splash effect when selected. Here's how to disable this.
Two effective techniques for reducing code generation times for Flutter apps that use build_runner.
Easy ways to improve your Dart & Flutter code. Published weekly.
Easy ways to improve your Dart & Flutter code. Published weekly.
Easy ways to improve your Dart & Flutter code. Published weekly.
Easy ways to improve your Dart & Flutter code. Published weekly.
Easy ways to improve your Dart & Flutter code. Published weekly.
Easy ways to improve your Dart & Flutter code. Published weekly.
A useful tip to hide your Firebase config from git in your Flutter web projects.
FocusScopeNode provides a simpler way of move the focus between text fields in your Flutter forms.
How to remove some noise in your Dart code by using underscores for unused function arguments.
How to make your ListViews feel native on iOS by adding top and bottom separators.