Skip to content

Commit

Permalink
Add explanation when user refreshes swap data
Browse files Browse the repository at this point in the history
  • Loading branch information
redDwarf03 committed Oct 9, 2024
1 parent a1793f8 commit 8614fd2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -715,5 +715,6 @@
"earnHeaderAddLiquidityTxt": "To get LP token you have to provide liquidity here :",
"liquidityAddDesc": "Add liquidity to the pool and receive LP Tokens representing your share",
"keychainAddressCopied": "Keychain address copied",
"farmLockTokensSummaryMoreInfo": "More info"
"farmLockTokensSummaryMoreInfo": "More info",
"swapRefreshDone": "Your swap data has been refreshed"
}
3 changes: 2 additions & 1 deletion lib/l10n/intl_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -695,5 +695,6 @@
"withdrawFarmLockDone": "Retrait complété avec succès",
"claimFarmLockDone": "Réclamation complétée avec succès",
"levelUpFarmLockDone": "Montée de niveau complétée avec succès",
"farmLockTokensSummaryMoreInfo": "Plus d'infos"
"farmLockTokensSummaryMoreInfo": "Plus d'infos",
"swapRefreshDone": "Les données liées à votre échange ont été rafraîchies."
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import 'package:aewallet/modules/aeswap/application/balance.dart';
import 'package:aewallet/ui/themes/archethic_theme.dart';
import 'package:aewallet/ui/util/ui_util.dart';
import 'package:aewallet/ui/views/aeswap_swap/bloc/provider.dart';
import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart'
as aedappfm;
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:material_symbols_icons/symbols.dart';

class SwapTokenIconRefresh extends ConsumerStatefulWidget {
const SwapTokenIconRefresh({
Expand All @@ -26,6 +30,7 @@ class _SwapTokenIconRefreshState extends ConsumerState<SwapTokenIconRefresh> {

@override
Widget build(BuildContext context) {
final localizations = AppLocalizations.of(context)!;
return IconButton(
icon: Icon(
isRefreshSuccess != null && isRefreshSuccess == true
Expand Down Expand Up @@ -75,7 +80,16 @@ class _SwapTokenIconRefreshState extends ConsumerState<SwapTokenIconRefresh> {
await swapNotifier.getPool();
}

await Future.delayed(const Duration(seconds: 2));
UIUtil.showSnackbar(
localizations.swapRefreshDone,
context,
ref,
ArchethicTheme.text,
ArchethicTheme.snackBarShadow,
icon: Symbols.info,
);

await Future.delayed(const Duration(seconds: 4));
if (mounted) {
setState(
() {
Expand Down

0 comments on commit 8614fd2

Please sign in to comment.