multiple payout page and small fixes
This commit is contained in:
@@ -6,10 +6,11 @@ import 'package:pshared/models/payment/type.dart';
|
||||
import 'package:pshared/models/recipient/recipient.dart';
|
||||
import 'package:pshared/models/payment/wallet.dart';
|
||||
|
||||
import 'package:pweb/models/dashboard_payment_mode.dart';
|
||||
import 'package:pweb/pages/dashboard/buttons/balance/balance.dart';
|
||||
import 'package:pweb/pages/dashboard/buttons/balance/controller.dart';
|
||||
import 'package:pweb/pages/dashboard/buttons/buttons.dart';
|
||||
import 'package:pweb/pages/dashboard/payouts/multiple/title.dart';
|
||||
import 'package:pweb/pages/dashboard/payouts/multiple/widgets/title.dart';
|
||||
import 'package:pweb/pages/dashboard/payouts/multiple/widget.dart';
|
||||
import 'package:pweb/pages/dashboard/payouts/single/widget.dart';
|
||||
import 'package:pweb/pages/loader.dart';
|
||||
@@ -42,19 +43,19 @@ class DashboardPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _DashboardPageState extends State<DashboardPage> {
|
||||
bool _showContainerSingle = true;
|
||||
bool _showContainerMultiple = false;
|
||||
DashboardPayoutMode _payoutMode = DashboardPayoutMode.single;
|
||||
|
||||
void _setActive(bool single) {
|
||||
void _setActive(DashboardPayoutMode mode) {
|
||||
setState(() {
|
||||
_showContainerSingle = single;
|
||||
_showContainerMultiple = !single;
|
||||
_payoutMode = mode;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final showSingle = _payoutMode == DashboardPayoutMode.single;
|
||||
final showMultiple = _payoutMode == DashboardPayoutMode.multiple;
|
||||
return PageViewLoader(
|
||||
child: SafeArea(
|
||||
child: SingleChildScrollView(
|
||||
@@ -66,8 +67,8 @@ class _DashboardPageState extends State<DashboardPage> {
|
||||
Expanded(
|
||||
flex: 0,
|
||||
child: TransactionRefButton(
|
||||
onTap: () => _setActive(true),
|
||||
isActive: _showContainerSingle,
|
||||
onTap: () => _setActive(DashboardPayoutMode.single),
|
||||
isActive: showSingle,
|
||||
label: l10n.sendSingle,
|
||||
icon: Icons.person_add,
|
||||
),
|
||||
@@ -76,8 +77,8 @@ class _DashboardPageState extends State<DashboardPage> {
|
||||
Expanded(
|
||||
flex: 0,
|
||||
child: TransactionRefButton(
|
||||
onTap: () => _setActive(false),
|
||||
isActive: _showContainerMultiple,
|
||||
onTap: () => _setActive(DashboardPayoutMode.multiple),
|
||||
isActive: showMultiple,
|
||||
label: l10n.sendMultiple,
|
||||
icon: Icons.group_add,
|
||||
),
|
||||
@@ -93,14 +94,14 @@ class _DashboardPageState extends State<DashboardPage> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: AppSpacing.small),
|
||||
if (_showContainerMultiple) TitleMultiplePayout(),
|
||||
if (showMultiple) TitleMultiplePayout(),
|
||||
const SizedBox(height: AppSpacing.medium),
|
||||
if (_showContainerSingle)
|
||||
if (showSingle)
|
||||
SinglePayoutForm(
|
||||
onRecipientSelected: widget.onRecipientSelected,
|
||||
onGoToPayment: widget.onGoToPaymentWithoutRecipient,
|
||||
),
|
||||
if (_showContainerMultiple) MultiplePayoutForm(),
|
||||
if (showMultiple) MultiplePayoutForm(),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user