Files
sendico/frontend/pweb/lib/pages/payout_page/wallet/card.dart
2025-12-24 19:59:50 +01:00

78 lines
2.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:pshared/utils/currency.dart';
import 'package:pshared/models/payment/wallet.dart';
import 'package:pweb/pages/dashboard/buttons/balance/amount.dart';
import 'package:pshared/provider/payment/wallets.dart';
import 'package:pweb/generated/i18n/app_localizations.dart';
class WalletCard extends StatelessWidget {
final Wallet wallet;
final VoidCallback onTap;
const WalletCard({super.key, required this.wallet, required this.onTap});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Card(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
elevation: theme.cardTheme.elevation ?? 4,
color: theme.colorScheme.onSecondary,
child: InkWell(
borderRadius: BorderRadius.circular(12),
onTap: onTap,
child: Container(
padding: const EdgeInsets.only(left: 50, top: 16, bottom: 16),
child: Row(
spacing: 3,
children: [
CircleAvatar(
radius: 24,
child: Icon(iconForCurrencyType(wallet.currency), size: 28),
),
const SizedBox(width: 16),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BalanceAmount(
wallet: wallet,
onToggleVisibility: () {
context.read<WalletsProvider>().toggleVisibility(wallet.id);
},
),
Text(
AppLocalizations.of(context)!.paymentTypeCryptoWallet,
style: theme.textTheme.bodyLarge!.copyWith(
fontWeight: FontWeight.w600,
color: theme.colorScheme.onSurface,
),
),
if (wallet.tokenSymbol != null) ...[
const SizedBox(height: 4),
Text(
wallet.tokenSymbol!,
style: theme.textTheme.bodyMedium?.copyWith(
color: theme.colorScheme.onSurfaceVariant,
),
),
],
],
),
),
],
),
),
),
);
}
}