Merge pull request #808 from cake-tech/fix-null-checks-on-disposed-screens

Fix null checks on disposed screens
This commit is contained in:
Omar Hatem 2023-02-27 18:39:16 +02:00 committed by GitHub
commit 18a8ad04d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View file

@ -8,7 +8,6 @@ import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/menu_widget.dart';

View file

@ -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(

View file

@ -379,7 +379,8 @@ class SendPage extends BasePage {
if (state is ExecutedSuccessfullyState) {
WidgetsBinding.instance.addPostFrameCallback((_) {
showPopUp<void>(
if (context.mounted) {
showPopUp<void>(
context: context,
builder: (BuildContext context) {
return ConfirmSendingAlert(
@ -423,6 +424,7 @@ class SendPage extends BasePage {
},
actionLeftButton: () => Navigator.of(context).pop());
});
}
});
}