Files
sendico/frontend/pweb/lib/widgets/refresh_balance/wallet.dart
Stephan D 218c4e20b3
All checks were successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/discovery Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/gateway_mntx Pipeline was successful
ci/woodpecker/push/gateway_chain Pipeline was successful
ci/woodpecker/push/gateway_tgsettle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
accounts creation
2026-01-23 00:13:43 +01:00

47 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:pshared/provider/payment/wallets.dart';
import 'package:pweb/models/visibility.dart';
import 'package:pweb/widgets/refresh_balance/button.dart';
import 'package:pweb/generated/i18n/app_localizations.dart';
class WalletBalanceRefreshButton extends StatelessWidget {
final String walletRef;
final VisibilityState iconOnly;
final double iconSize = 18;
const WalletBalanceRefreshButton({
super.key,
required this.walletRef,
this.iconOnly = VisibilityState.visible,
});
@override
Widget build(BuildContext context) {
final walletsProvider = context.watch<WalletsProvider>();
final loc = AppLocalizations.of(context)!;
final isBusy = walletsProvider.isWalletRefreshing(walletRef) || walletsProvider.isLoading;
final hasTarget = walletsProvider.wallets.any((w) => w.id == walletRef);
void refresh() {
final provider = context.read<WalletsProvider>();
provider.refreshBalance(walletRef);
}
return BalanceRefreshButton(
isBusy: isBusy,
enabled: hasTarget,
onPressed: refresh,
iconOnly: iconOnly,
label: loc.refreshBalance,
tooltip: loc.refreshBalance,
iconSize: iconSize,
);
}
}