diff --git a/frontend/pweb/lib/pages/dashboard/payouts/single/new_recipient/payout.dart b/frontend/pweb/lib/pages/dashboard/payouts/single/new_recipient/payout.dart deleted file mode 100644 index cdad3294..00000000 --- a/frontend/pweb/lib/pages/dashboard/payouts/single/new_recipient/payout.dart +++ /dev/null @@ -1,57 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:pshared/models/payment/type.dart'; - -import 'package:pweb/models/control_state.dart'; -import 'package:pweb/pages/dashboard/payouts/single/new_recipient/type.dart'; -import 'package:pweb/utils/payment/availability.dart'; - - -class SinglePayout extends StatelessWidget { - final void Function(PaymentType type) onGoToPayment; - - static const double _cardPadding = 30.0; - static const double _dividerPaddingVertical = 12.0; - static const double _cardBorderRadius = 12.0; - static const double _dividerThickness = 1.0; - - const SinglePayout({super.key, required this.onGoToPayment}); - - @override - Widget build(BuildContext context) { - final paymentTypes = visiblePaymentTypes; - final dividerColor = Theme.of(context).dividerColor; - - return SizedBox( - width: double.infinity, - child: Card( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(_cardBorderRadius), - ), - elevation: 4, - color: Theme.of(context).colorScheme.onSecondary, - child: Padding( - padding: const EdgeInsets.all(_cardPadding), - child: Column( - children: [ - for (int i = 0; i < paymentTypes.length; i++) ...[ - PaymentTypeTile( - type: paymentTypes[i], - onSelected: onGoToPayment, - state: disabledPaymentTypes.contains(paymentTypes[i]) - ? ControlState.disabled - : ControlState.enabled, - ), - if (i < paymentTypes.length - 1) - Padding( - padding: const EdgeInsets.symmetric(vertical: _dividerPaddingVertical), - child: Divider(thickness: _dividerThickness, color: dividerColor), - ), - ], - ], - ), - ), - ), - ); - } -} diff --git a/frontend/pweb/lib/pages/dashboard/payouts/single/new_recipient/type.dart b/frontend/pweb/lib/pages/dashboard/payouts/single/new_recipient/type.dart deleted file mode 100644 index c191fda1..00000000 --- a/frontend/pweb/lib/pages/dashboard/payouts/single/new_recipient/type.dart +++ /dev/null @@ -1,65 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:pshared/models/payment/type.dart'; - -import 'package:pweb/models/control_state.dart'; -import 'package:pweb/pages/payment_methods/icon.dart'; -import 'package:pweb/utils/payment/label.dart'; - - -class PaymentTypeTile extends StatelessWidget { - final PaymentType type; - final void Function(PaymentType type) onSelected; - final ControlState state; - - const PaymentTypeTile({ - super.key, - required this.type, - required this.onSelected, - this.state = ControlState.enabled, - }); - - @override - Widget build(BuildContext context) { - final label = getPaymentTypeLabel(context, type); - - final theme = Theme.of(context); - final isEnabled = state == ControlState.enabled; - final isDisabled = state == ControlState.disabled; - final isLoading = state == ControlState.loading; - final textColor = isDisabled - ? theme.colorScheme.onSurface.withValues(alpha: 0.55) - : theme.colorScheme.onSurface; - - return InkWell( - borderRadius: BorderRadius.circular(8), - onTap: isEnabled ? () => onSelected(type) : null, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: Row( - children: [ - Icon(iconForPaymentType(type), size: 24, color: textColor), - const SizedBox(width: 12), - Text( - label, - style: theme.textTheme.bodyMedium?.copyWith(color: textColor), - ), - if (isLoading) ...[ - const SizedBox(width: 12), - SizedBox( - width: 16, - height: 16, - child: CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation( - theme.colorScheme.primary, - ), - ), - ), - ], - ], - ), - ), - ); - } -} diff --git a/frontend/pweb/lib/pages/dashboard/payouts/single/widget.dart b/frontend/pweb/lib/pages/dashboard/payouts/single/widget.dart index 8336d558..705127f5 100644 --- a/frontend/pweb/lib/pages/dashboard/payouts/single/widget.dart +++ b/frontend/pweb/lib/pages/dashboard/payouts/single/widget.dart @@ -4,7 +4,6 @@ import 'package:pshared/models/payment/type.dart'; import 'package:pshared/models/recipient/recipient.dart'; import 'package:pweb/pages/dashboard/payouts/single/address_book/widget.dart'; -import 'package:pweb/pages/dashboard/payouts/single/new_recipient/payout.dart'; class SinglePayoutForm extends StatelessWidget { @@ -17,18 +16,13 @@ class SinglePayoutForm extends StatelessWidget { required this.onGoToPayment, }); - static const double _spacingBetweenAddressAndForm = 20.0; - static const double _bottomSpacing = 40.0; - @override Widget build(BuildContext context) { return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ AddressBookPayout(onSelected: onRecipientSelected), - const SizedBox(height: _spacingBetweenAddressAndForm), - SinglePayout(onGoToPayment: onGoToPayment), - const SizedBox(height: _bottomSpacing), + //TODO Add history of recent wallets/payments ], ); }