Connect customer quotations and payment execution to Sendico (#50)
This commit is contained in:
1 parent
5d67c25c8e
commit
7a6510d1a8
45 files changed
+2696
-45
No files matched your search
@@ -133,6 +133,15 @@ class TransferPageState extends State<TransferPage> {
|
||||
final t = Theme.of(context);
|
||||
final accounts = wallet.data?.accounts ?? [];
|
||||
final source = wallet.account(p.source);
|
||||
final live = !wallet.service.isSimulated;
|
||||
final expiresIn =
|
||||
p.quote?.expiresAt.difference(DateTime.now()).inSeconds ?? 0;
|
||||
final unavailableMethod =
|
||||
live &&
|
||||
((widget.kind == TransferKind.payout &&
|
||||
(source?.payoutMethod.isEmpty ?? true)) ||
|
||||
(widget.kind == TransferKind.topUp &&
|
||||
!(source?.canFund ?? false)));
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Center(
|
||||
@@ -207,7 +216,15 @@ class TransferPageState extends State<TransferPage> {
|
||||
] else if (p.quote != null) ...[
|
||||
TransferSummary(quote: p.quote!),
|
||||
const SizedBox(height: 16),
|
||||
Text(p.expired ? l.wExpired : l.wQuoteNotice),
|
||||
Text(
|
||||
p.expired
|
||||
? l.wExpired
|
||||
: live
|
||||
? l.wLiveQuoteNotice(
|
||||
expiresIn < 0 ? 0 : expiresIn,
|
||||
)
|
||||
: l.wQuoteNotice,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
if (p.expired)
|
||||
FilledButton(
|
||||
@@ -299,21 +316,39 @@ class TransferPageState extends State<TransferPage> {
|
||||
),
|
||||
if (widget.kind == TransferKind.payout) ...[
|
||||
const SizedBox(height: 20),
|
||||
TextField(
|
||||
key: const ValueKey('transfer-recipient'),
|
||||
controller: _recipient,
|
||||
enabled: !p.busy,
|
||||
decoration: InputDecoration(
|
||||
labelText: l.wRecipient,
|
||||
hintText: l.wRecipientHint,
|
||||
if (live && source?.payoutMethod.isNotEmpty == true)
|
||||
InputDecorator(
|
||||
decoration: InputDecoration(
|
||||
labelText: l.wRecipient,
|
||||
),
|
||||
child: Text(source!.payoutLabel),
|
||||
),
|
||||
onChanged: (v) => p.change(recipient: v),
|
||||
if (!live)
|
||||
TextField(
|
||||
key: const ValueKey('transfer-recipient'),
|
||||
controller: _recipient,
|
||||
enabled: !p.busy,
|
||||
decoration: InputDecoration(
|
||||
labelText: l.wRecipient,
|
||||
hintText: l.wRecipientHint,
|
||||
),
|
||||
onChanged: (v) => p.change(recipient: v),
|
||||
),
|
||||
],
|
||||
if (unavailableMethod) ...[
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
widget.kind == TransferKind.payout
|
||||
? l.wNoPayoutMethod
|
||||
: l.wNoFundingMethod,
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 28),
|
||||
FilledButton(
|
||||
key: const ValueKey('transfer-review'),
|
||||
onPressed: p.busy ? null : p.review,
|
||||
onPressed: p.busy || unavailableMethod
|
||||
? null
|
||||
: p.review,
|
||||
child: Text(l.wReview),
|
||||
),
|
||||
if (p.error == WalletError.limitExceeded)
|
||||
|
||||
Reference in new issue
Block a user