medium10 pts · first answer countscross-platform-mobileflutterdart-async
Using BuildContext after an await
The analyzer warns "Don't use BuildContext across async gaps" on this code. What is the safe fix?
onPressed: () async {
await repo.save(form);
Navigator.of(context).pop();
}Discussion 0
Join free to post in the discussion.
Related questions
- StatelessWidget or StatefulWidgetMobile App Developer
- Flutter hot reload vs restartMobile App Developer
- Dart final versus constMobile App Developer
- What a BuildContext isMobile App Developer
- Reading the screen widthMobile App Developer
- Expanded inside a RowMobile App Developer
- ListView.builder for a long feedMobile App Developer
- Role of pubspec.yamlMobile App Developer