ledger top up functionality and few small fixes for project architechture and design
This commit is contained in:
@@ -228,6 +228,7 @@ RouteBase payoutShellRoute() => ShellRoute(
|
||||
onGoToPaymentWithoutRecipient: (type) =>
|
||||
_startPayment(context, recipient: null, paymentType: type),
|
||||
onTopUp: (wallet) => _openWalletTopUp(context, wallet),
|
||||
onLedgerAddFunds: (account) => _openLedgerAddFunds(context, account),
|
||||
onWalletTap: (wallet) => _openWalletEdit(context, wallet),
|
||||
onLedgerTap: (account) => _openLedgerEdit(context, account),
|
||||
),
|
||||
@@ -306,6 +307,8 @@ RouteBase payoutShellRoute() => ShellRoute(
|
||||
child: PaymentPage(
|
||||
onBack: (_) => _popOrGo(context),
|
||||
initialPaymentType: PayoutRoutes.paymentTypeFromState(state),
|
||||
initialDestinationLedgerAccountRef:
|
||||
PayoutRoutes.destinationLedgerAccountRefFromState(state),
|
||||
fallbackDestination: fallbackDestination,
|
||||
),
|
||||
);
|
||||
@@ -395,6 +398,20 @@ void _openLedgerEdit(BuildContext context, LedgerAccount account) {
|
||||
context.pushToEditWallet();
|
||||
}
|
||||
|
||||
void _openLedgerAddFunds(BuildContext context, LedgerAccount account) {
|
||||
context.read<PaymentSourceController>().selectLedgerByRef(
|
||||
account.ledgerAccountRef,
|
||||
);
|
||||
context.read<RecipientsProvider>().setCurrentObject(null);
|
||||
context.pushNamed(
|
||||
PayoutRoutes.payment,
|
||||
queryParameters: PayoutRoutes.buildQueryParameters(
|
||||
paymentType: PaymentType.ledger,
|
||||
destinationLedgerAccountRef: account.ledgerAccountRef,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _openWalletTopUp(BuildContext context, Wallet wallet) {
|
||||
context.read<WalletsController>().selectWallet(wallet);
|
||||
context.pushToWalletTopUp();
|
||||
|
||||
Reference in New Issue
Block a user