57 lines
1.6 KiB
Dart
57 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:pweb/models/wallet.dart';
|
|
import 'package:pweb/pages/dashboard/buttons/balance/add_funds.dart';
|
|
import 'package:pweb/pages/dashboard/buttons/balance/amount.dart';
|
|
import 'package:pweb/pages/dashboard/buttons/balance/config.dart';
|
|
import 'package:pweb/pages/dashboard/buttons/balance/header.dart';
|
|
import 'package:pweb/providers/wallets.dart';
|
|
|
|
|
|
class WalletCard extends StatelessWidget {
|
|
final Wallet wallet;
|
|
final VoidCallback onTopUp;
|
|
|
|
const WalletCard({
|
|
super.key,
|
|
required this.wallet,
|
|
required this.onTopUp,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Card(
|
|
color: Theme.of(context).colorScheme.onSecondary,
|
|
elevation: WalletCardConfig.elevation,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(WalletCardConfig.borderRadius),
|
|
),
|
|
child: Padding(
|
|
padding: WalletCardConfig.contentPadding,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
BalanceHeader(
|
|
walletName: wallet.name,
|
|
walletId: wallet.walletUserID,
|
|
),
|
|
BalanceAmount(
|
|
wallet: wallet,
|
|
onToggleVisibility: () {
|
|
context.read<WalletsProvider>().toggleVisibility(wallet.id);
|
|
},
|
|
),
|
|
BalanceAddFunds(
|
|
onTopUp: () {
|
|
onTopUp();
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|