Check if context is still mounted before showing a popup [skip ci]

This commit is contained in:
OmarHatem
2023-02-27 15:59:20 +02:00
parent ac099075b7
commit 2c43f29d64
3 changed files with 9 additions and 4 deletions
@@ -117,7 +117,8 @@ class AddressPage extends BasePage {
}
await Future<void>.delayed(Duration(seconds: 1));
await showPopUp<void>(
if (context.mounted) {
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(
@@ -131,6 +132,7 @@ class AddressPage extends BasePage {
Navigator.of(context).pop();
});
});
}
});
return KeyboardActions(