Multiple Wallet support, history of each wallet and updated payment page
This commit is contained in:
73
frontend/pweb/lib/pages/payout_page/wallet/edit/page.dart
Normal file
73
frontend/pweb/lib/pages/payout_page/wallet/edit/page.dart
Normal file
@@ -0,0 +1,73 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:pweb/pages/payout_page/wallet/edit/buttons/buttons.dart';
|
||||
import 'package:pweb/pages/payout_page/wallet/edit/fields.dart';
|
||||
import 'package:pweb/pages/payout_page/wallet/edit/header.dart';
|
||||
import 'package:pweb/pages/payout_page/wallet/history/history.dart';
|
||||
import 'package:pweb/providers/wallets.dart';
|
||||
import 'package:pweb/utils/dimensions.dart';
|
||||
|
||||
|
||||
class WalletEditPage extends StatelessWidget {
|
||||
final VoidCallback onBack;
|
||||
|
||||
const WalletEditPage({super.key, required this.onBack});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final dimensions = AppDimensions();
|
||||
|
||||
return Consumer<WalletsProvider>(
|
||||
builder: (context, provider, child) {
|
||||
final wallet = provider.selectedWallet;
|
||||
|
||||
if (wallet == null) {
|
||||
return Center(child: Text('Кошелёк не выбран'));
|
||||
}
|
||||
|
||||
return Align(
|
||||
alignment: Alignment.topCenter,
|
||||
child: Column(
|
||||
children: [
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: dimensions.maxContentWidth),
|
||||
child: Material(
|
||||
elevation: dimensions.elevationSmall,
|
||||
color: Theme.of(context).colorScheme.onSecondary,
|
||||
borderRadius: BorderRadius.circular(dimensions.borderRadiusMedium),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(dimensions.paddingLarge),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: onBack,
|
||||
),
|
||||
WalletEditHeader(),
|
||||
WalletEditFields(),
|
||||
const SizedBox(height: 24),
|
||||
ButtonsWalletWidget(),
|
||||
const SizedBox(height: 24),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: WalletHistory(wallet: wallet),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user