mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
Gracefully handle toast messages error on desktop platforms
This commit is contained in:
@@ -87,10 +87,7 @@ class BalanceRowWidget extends StatelessWidget {
|
||||
// ],
|
||||
),
|
||||
child: TextButton(
|
||||
onPressed: () => Fluttertoast.showToast(
|
||||
msg: S.current.show_balance_toast,
|
||||
backgroundColor: Color.fromRGBO(0, 0, 0, 0.85),
|
||||
),
|
||||
onPressed: _showToast,
|
||||
onLongPress: () => dashboardViewModel.balanceViewModel.switchBalanceValue(),
|
||||
style: TextButton.styleFrom(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
|
||||
@@ -366,10 +363,7 @@ class BalanceRowWidget extends StatelessWidget {
|
||||
// ],
|
||||
),
|
||||
child: TextButton(
|
||||
onPressed: () => Fluttertoast.showToast(
|
||||
msg: S.current.show_balance_toast,
|
||||
backgroundColor: Color.fromRGBO(0, 0, 0, 0.85),
|
||||
),
|
||||
onPressed: _showToast,
|
||||
onLongPress: () => dashboardViewModel.balanceViewModel.switchBalanceValue(),
|
||||
style: TextButton.styleFrom(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
|
||||
@@ -709,4 +703,13 @@ class BalanceRowWidget extends StatelessWidget {
|
||||
void _showBalanceDescription(BuildContext context, String content) {
|
||||
showPopUp<void>(context: context, builder: (_) => InformationPage(information: content));
|
||||
}
|
||||
|
||||
void _showToast() async {
|
||||
try {
|
||||
await Fluttertoast.showToast(
|
||||
msg: S.current.show_balance_toast,
|
||||
backgroundColor: Color.fromRGBO(0, 0, 0, 0.85),
|
||||
);
|
||||
} catch (_) {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user