From db0765ec383f5df84dd90027e22eecdf167c00e7 Mon Sep 17 00:00:00 2001 From: Brett Morgan Date: Thu, 30 May 2024 06:57:47 +1000 Subject: [PATCH] Make sure context is mounted --- ai_recipe_generation/lib/features/prompt/prompt_screen.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/ai_recipe_generation/lib/features/prompt/prompt_screen.dart b/ai_recipe_generation/lib/features/prompt/prompt_screen.dart index a44d8bd61c1..0abc8a2b497 100644 --- a/ai_recipe_generation/lib/features/prompt/prompt_screen.dart +++ b/ai_recipe_generation/lib/features/prompt/prompt_screen.dart @@ -251,6 +251,7 @@ class PromptScreen extends StatelessWidget { child: MarketplaceButton( onPressed: () async { await viewModel.submitPrompt().then((_) async { + if (!context.mounted) return; if (viewModel.recipe != null) { bool? shouldSave = await showDialog( context: context,