Files
sendico/frontend/pweb/lib/pages/payout_page/wallet/edit/page.dart
2025-12-24 19:59:50 +01:00

77 lines
2.6 KiB
Dart

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:pshared/provider/payment/wallets.dart';
import 'package:pweb/utils/dimensions.dart';
import 'package:pweb/generated/i18n/app_localizations.dart';
class WalletEditPage extends StatelessWidget {
final VoidCallback onBack;
const WalletEditPage({super.key, required this.onBack});
@override
Widget build(BuildContext context) {
final dimensions = AppDimensions();
final loc = AppLocalizations.of(context)!;
return Consumer<WalletsProvider>(
builder: (context, provider, child) {
final wallet = provider.selectedWallet;
if (wallet == null) {
return Center(child: Text(loc.noWalletSelected));
}
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),
),
),
],
),
);
},
);
}
}