removed payment methods page for now
This commit is contained in:
@@ -15,10 +15,12 @@ import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
class BalanceWidget extends StatelessWidget {
|
||||
final ValueChanged<Wallet> onTopUp;
|
||||
final ValueChanged<Wallet> onWalletTap;
|
||||
|
||||
const BalanceWidget({
|
||||
super.key,
|
||||
required this.onTopUp,
|
||||
required this.onWalletTap,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -74,6 +76,7 @@ class BalanceWidget extends StatelessWidget {
|
||||
}
|
||||
},
|
||||
onTopUp: onTopUp,
|
||||
onWalletTap: onWalletTap,
|
||||
);
|
||||
|
||||
if (wallets.isEmpty && accounts.isEmpty) {
|
||||
|
||||
@@ -19,11 +19,13 @@ import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
class WalletCard extends StatelessWidget {
|
||||
final Wallet wallet;
|
||||
final VoidCallback onTopUp;
|
||||
final VoidCallback onTap;
|
||||
|
||||
const WalletCard({
|
||||
super.key,
|
||||
required this.wallet,
|
||||
required this.onTopUp,
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -40,6 +42,9 @@ class WalletCard extends StatelessWidget {
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(WalletCardConfig.borderRadius),
|
||||
),
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(WalletCardConfig.borderRadius),
|
||||
onTap: onTap,
|
||||
child: SizedBox.expand(
|
||||
child: Padding(
|
||||
padding: WalletCardConfig.contentPadding,
|
||||
@@ -70,7 +75,7 @@ class WalletCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ class BalanceCarousel extends StatefulWidget {
|
||||
final int currentIndex;
|
||||
final ValueChanged<int> onIndexChanged;
|
||||
final ValueChanged<Wallet> onTopUp;
|
||||
final ValueChanged<Wallet> onWalletTap;
|
||||
|
||||
const BalanceCarousel({
|
||||
super.key,
|
||||
@@ -23,6 +24,7 @@ class BalanceCarousel extends StatefulWidget {
|
||||
required this.currentIndex,
|
||||
required this.onIndexChanged,
|
||||
required this.onTopUp,
|
||||
required this.onWalletTap,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -101,6 +103,7 @@ class _BalanceCarouselState extends State<BalanceCarousel> {
|
||||
BalanceItemType.wallet => WalletCard(
|
||||
wallet: item.wallet!,
|
||||
onTopUp: () => widget.onTopUp(item.wallet!),
|
||||
onTap: () => widget.onWalletTap(item.wallet!),
|
||||
),
|
||||
BalanceItemType.ledger => LedgerAccountCard(account: item.account!),
|
||||
BalanceItemType.addAction => const AddBalanceCard(),
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
abstract class WalletCardConfig {
|
||||
static const double cardHeight = 130.0;
|
||||
static const double cardHeight = 145.0;
|
||||
static const double elevation = 4.0;
|
||||
static const double borderRadius = 16.0;
|
||||
static const double viewportFraction = 0.9;
|
||||
|
||||
@@ -27,12 +27,14 @@ class DashboardPage extends StatefulWidget {
|
||||
final ValueChanged<Recipient> onRecipientSelected;
|
||||
final void Function(PaymentType type) onGoToPaymentWithoutRecipient;
|
||||
final ValueChanged<Wallet> onTopUp;
|
||||
final ValueChanged<Wallet> onWalletTap;
|
||||
|
||||
const DashboardPage({
|
||||
super.key,
|
||||
required this.onRecipientSelected,
|
||||
required this.onGoToPaymentWithoutRecipient,
|
||||
required this.onTopUp,
|
||||
required this.onWalletTap,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -88,6 +90,7 @@ class _DashboardPageState extends State<DashboardPage> {
|
||||
create: (_) => CarouselIndexController(),
|
||||
child: BalanceWidget(
|
||||
onTopUp: widget.onTopUp,
|
||||
onWalletTap: widget.onWalletTap,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: AppSpacing.small),
|
||||
|
||||
Reference in New Issue
Block a user