solyanka iz fix for payout page design, ledger wallet now clickable
This commit is contained in:
@@ -1,55 +1,30 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:pshared/controllers/balance_mask/wallets.dart';
|
||||
|
||||
import 'package:pweb/pages/dashboard/buttons/balance/amount.dart';
|
||||
import 'package:pweb/widgets/refresh_balance/wallet.dart';
|
||||
import 'package:pshared/controllers/payment/source.dart';
|
||||
|
||||
import 'package:pweb/pages/payout_page/wallet/edit/fields/ledger/section.dart';
|
||||
import 'package:pweb/pages/payout_page/wallet/edit/fields/wallet/wallet_section.dart';
|
||||
|
||||
class WalletEditFields extends StatelessWidget {
|
||||
const WalletEditFields({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<WalletsController>(
|
||||
builder: (context, controller, _) {
|
||||
final wallet = controller.selectedWallet;
|
||||
|
||||
if (wallet == null) {
|
||||
return SizedBox.shrink();
|
||||
return Consumer<PaymentSourceController>(
|
||||
builder: (context, sourceController, _) {
|
||||
final wallet = sourceController.selectedWallet;
|
||||
if (wallet != null) {
|
||||
return WalletSection(wallet: wallet);
|
||||
}
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: BalanceAmount(
|
||||
wallet: wallet,
|
||||
onToggleMask: () => controller.toggleBalanceMask(wallet.id),
|
||||
),
|
||||
),
|
||||
WalletBalanceRefreshButton(walletRef: wallet.id),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(wallet.walletUserID, style: Theme.of(context).textTheme.bodyLarge),
|
||||
IconButton(
|
||||
icon: Icon(Icons.copy),
|
||||
iconSize: 18,
|
||||
onPressed: () => Clipboard.setData(ClipboardData(text: wallet.walletUserID)),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
final ledger = sourceController.selectedLedgerAccount;
|
||||
if (ledger != null) {
|
||||
return LedgerSection(ledger: ledger);
|
||||
}
|
||||
|
||||
return const SizedBox.shrink();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user