From 9332638a9b8bd28be87af40d4c046cc3db9556da Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 6 Mar 2023 14:01:48 -0600 Subject: [PATCH] widget mounted checks --- .../exchange_view/trade_details_view.dart | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/lib/pages/exchange_view/trade_details_view.dart b/lib/pages/exchange_view/trade_details_view.dart index b63e7bf7e..bb9316c27 100644 --- a/lib/pages/exchange_view/trade_details_view.dart +++ b/lib/pages/exchange_view/trade_details_view.dart @@ -668,11 +668,15 @@ class _TradeDetailsViewState extends ConsumerState { text: address, ), ); - unawaited(showFloatingFlushBar( - type: FlushBarType.info, - message: "Copied to clipboard", - context: context, - )); + if (mounted) { + unawaited( + showFloatingFlushBar( + type: FlushBarType.info, + message: "Copied to clipboard", + context: context, + ), + ); + } }, child: Row( children: [ @@ -1123,11 +1127,15 @@ class _TradeDetailsViewState extends ConsumerState { onTap: () async { final data = ClipboardData(text: trade.tradeId); await clipboard.setData(data); - unawaited(showFloatingFlushBar( - type: FlushBarType.info, - message: "Copied to clipboard", - context: context, - )); + if (mounted) { + unawaited( + showFloatingFlushBar( + type: FlushBarType.info, + message: "Copied to clipboard", + context: context, + ), + ); + } }, child: SvgPicture.asset( Assets.svg.copy,