Update unspent_coins_list_page.dart

This commit is contained in:
Serhii 2025-06-25 23:12:50 +03:00
parent 65bb917bfb
commit 71c4f507ac

View file

@ -41,14 +41,17 @@ class UnspentCoinsListPage extends BasePage {
final UnspentCoinsListViewModel unspentCoinsListViewModel; final UnspentCoinsListViewModel unspentCoinsListViewModel;
Future<void> handleOnPopInvoked(BuildContext context) async { Future<void> handleOnPopInvoked(BuildContext context) async {
final navigator = Navigator.of(context);
final hasChanged = unspentCoinsListViewModel.hasAdjustableFieldChanged; final hasChanged = unspentCoinsListViewModel.hasAdjustableFieldChanged;
if (unspentCoinsListViewModel.items.isEmpty || !hasChanged) { if (unspentCoinsListViewModel.items.isEmpty || !hasChanged) {
Navigator.of(context).pop(); if (navigator.canPop()) navigator.pop();
} else { return;
unspentCoinsListViewModel.setIsDisposing(true);
await unspentCoinsListViewModel.dispose();
Navigator.of(context).pop();
} }
unspentCoinsListViewModel.setIsDisposing(true);
await unspentCoinsListViewModel.dispose();
Navigator.of(context).pop();
if (navigator.canPop()) navigator.pop();
} }
@override @override