accounts creation
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
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
This commit is contained in:
57
frontend/pweb/lib/widgets/refresh_balance/button.dart
Normal file
57
frontend/pweb/lib/widgets/refresh_balance/button.dart
Normal file
@@ -0,0 +1,57 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:pweb/models/visibility.dart';
|
||||
|
||||
|
||||
class BalanceRefreshButton extends StatelessWidget {
|
||||
final bool isBusy;
|
||||
final bool enabled;
|
||||
final VoidCallback onPressed;
|
||||
final VisibilityState iconOnly;
|
||||
final String label;
|
||||
final String tooltip;
|
||||
final double iconSize;
|
||||
|
||||
const BalanceRefreshButton({
|
||||
super.key,
|
||||
required this.isBusy,
|
||||
required this.enabled,
|
||||
required this.onPressed,
|
||||
required this.iconOnly,
|
||||
required this.label,
|
||||
required this.tooltip,
|
||||
this.iconSize = 18,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final canPress = enabled && !isBusy;
|
||||
|
||||
if (iconOnly == VisibilityState.hidden) {
|
||||
return IconButton(
|
||||
tooltip: tooltip,
|
||||
onPressed: canPress ? onPressed : null,
|
||||
icon: isBusy
|
||||
? SizedBox(
|
||||
width: iconSize,
|
||||
height: iconSize,
|
||||
child: const CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Icon(Icons.refresh),
|
||||
);
|
||||
}
|
||||
|
||||
return TextButton.icon(
|
||||
onPressed: canPress ? onPressed : null,
|
||||
icon: isBusy
|
||||
? SizedBox(
|
||||
width: iconSize,
|
||||
height: iconSize,
|
||||
child: const CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Icon(Icons.refresh),
|
||||
label: Text(label),
|
||||
style: TextButton.styleFrom(visualDensity: VisualDensity.compact),
|
||||
);
|
||||
}
|
||||
}
|
||||
46
frontend/pweb/lib/widgets/refresh_balance/ledger.dart
Normal file
46
frontend/pweb/lib/widgets/refresh_balance/ledger.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:pshared/provider/ledger.dart';
|
||||
|
||||
import 'package:pweb/models/visibility.dart';
|
||||
import 'package:pweb/widgets/refresh_balance/button.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
|
||||
class LedgerBalanceRefreshButton extends StatelessWidget {
|
||||
final String ledgerAccountRef;
|
||||
final VisibilityState iconOnly;
|
||||
final double iconSize = 18;
|
||||
|
||||
const LedgerBalanceRefreshButton({
|
||||
super.key,
|
||||
required this.ledgerAccountRef,
|
||||
this.iconOnly = VisibilityState.visible,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ledgerProvider = context.watch<LedgerAccountsProvider>();
|
||||
final loc = AppLocalizations.of(context)!;
|
||||
final isBusy = ledgerProvider.isWalletRefreshing(ledgerAccountRef) || ledgerProvider.isLoading;
|
||||
final hasTarget = ledgerProvider.accounts.any((a) => a.ledgerAccountRef == ledgerAccountRef);
|
||||
|
||||
void refresh() {
|
||||
final provider = context.read<LedgerAccountsProvider>();
|
||||
provider.refreshBalance(ledgerAccountRef);
|
||||
}
|
||||
|
||||
return BalanceRefreshButton(
|
||||
isBusy: isBusy,
|
||||
enabled: hasTarget,
|
||||
onPressed: refresh,
|
||||
iconOnly: iconOnly,
|
||||
label: loc.refreshBalance,
|
||||
tooltip: loc.refreshBalance,
|
||||
iconSize: iconSize,
|
||||
);
|
||||
}
|
||||
}
|
||||
46
frontend/pweb/lib/widgets/refresh_balance/wallet.dart
Normal file
46
frontend/pweb/lib/widgets/refresh_balance/wallet.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
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/generated/i18n/app_localizations.dart';
|
||||
|
||||
|
||||
class WalletBalanceRefreshButton extends StatelessWidget {
|
||||
final String walletId;
|
||||
final VisibilityState iconOnly;
|
||||
final double iconSize = 18;
|
||||
|
||||
const WalletBalanceRefreshButton({
|
||||
super.key,
|
||||
required this.walletId,
|
||||
this.iconOnly = VisibilityState.visible,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final walletsProvider = context.watch<WalletsProvider>();
|
||||
final loc = AppLocalizations.of(context)!;
|
||||
final isBusy = walletsProvider.isWalletRefreshing(walletId) || walletsProvider.isLoading;
|
||||
final hasTarget = walletsProvider.wallets.any((w) => w.id == walletId);
|
||||
|
||||
void refresh() {
|
||||
final provider = context.read<WalletsProvider>();
|
||||
provider.refreshBalance(walletId);
|
||||
}
|
||||
|
||||
if (iconOnly == VisibilityState.hidden) {
|
||||
return IconButton(
|
||||
tooltip: loc.refreshBalance,
|
||||
onPressed: hasTarget && !isBusy ? refresh : null,
|
||||
icon: isBusy
|
||||
? SizedBox(
|
||||
width: iconSize,
|
||||
height: iconSize,
|
||||
child: const CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Icon(Icons.refresh),
|
||||
);
|
||||
}
|
||||
|
||||
return TextButton.icon(
|
||||
onPressed: hasTarget && !isBusy ? refresh : null,
|
||||
icon: isBusy
|
||||
? SizedBox(
|
||||
width: iconSize,
|
||||
height: iconSize,
|
||||
child: const CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Icon(Icons.refresh),
|
||||
label: Text(loc.refreshBalance),
|
||||
style: TextButton.styleFrom(visualDensity: VisualDensity.compact),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user