widget mounted checks

This commit is contained in:
julian 2023-03-06 14:01:48 -06:00
parent 3982ca29a6
commit 9332638a9b

View file

@ -668,11 +668,15 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
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<TradeDetailsView> {
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,