Skip to content
RED SAGSkills
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();
}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions