mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 14:58:34 +00:00
Fix master channel build (#1900)
- Fixes #1899 - Don't use BuildContext in async. - Disabled build script for `next-gen-ui-demo` for master channel because dependency gap does not compile. - Improve use BuildContext in `place_tracker`, added checks to verify that the context is still mounted, and avoid passing BuildContext as parameter. ## Pre-launch Checklist - [ ] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [ ] I signed the [CLA]. - [ ] I read the [Contributors Guide]. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. <!-- Links --> [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/wiki/Chat [Contributors Guide]: https://github.com/flutter/samples/blob/main/CONTRIBUTING.md
This commit is contained in:
@@ -58,6 +58,7 @@ class _HomePageState extends State<HomePage> {
|
||||
batteryLevel = result;
|
||||
});
|
||||
} catch (error) {
|
||||
if (!context.mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
|
||||
Reference in New Issue
Block a user