Check for context first before showing popup

OmarHatem committed Feb 15, 2023 at 17:50 UTC 54dab5883f283ec4897f9c62d17cf37dd36795bb
1 file changed +3 -1
lib/src/screens/dashboard/dashboard_page.dart
+3 -1
@@ -229,7 +229,8 @@ class DashboardPage extends BasePage {
229 }
230
231 await Future<void>.delayed(Duration(seconds: 1));
232 - await showPopUp<void>(
232 + if (context.mounted) {
233 + await showPopUp<void>(
234 context: context,
235 builder: (BuildContext context) {
236 return AlertWithOneAction(
@@ -239,6 +240,7 @@ class DashboardPage extends BasePage {
240 buttonText: S.of(context).understand,
241 buttonAction: () => Navigator.of(context).pop());
242 });
243 + }
244 });
245
246 var needToPresentYat = false;