fix: possible context null check issue in exchange trade (#2253)

This commit is contained in:
Serhii 2025-05-07 17:22:03 +03:00 committed by GitHub
parent b7473594cb
commit cab4792388
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -307,9 +307,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
if (state is TransactionCommitted) { if (state is TransactionCommitted) {
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
if (!context.mounted) { if (!mounted) return;
return;
}
await showModalBottomSheet<void>( await showModalBottomSheet<void>(
context: context, context: context,
@ -323,7 +321,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
actionButtonKey: ValueKey('send_page_sent_dialog_ok_button_key'), actionButtonKey: ValueKey('send_page_sent_dialog_ok_button_key'),
actionButton: () { actionButton: () {
Navigator.of(bottomSheetContext).pop(); Navigator.of(bottomSheetContext).pop();
if (context.mounted) { if (mounted) {
Navigator.of(context).pushNamedAndRemoveUntil( Navigator.of(context).pushNamedAndRemoveUntil(
Routes.dashboard, Routes.dashboard,
(route) => false, (route) => false,