Frontend first draft
This commit is contained in:
122
frontend/pweb/lib/pages/payment_page/wallet/edit/header.dart
Normal file
122
frontend/pweb/lib/pages/payment_page/wallet/edit/header.dart
Normal file
@@ -0,0 +1,122 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:pweb/utils/currency.dart';
|
||||
import 'package:pweb/utils/dimensions.dart';
|
||||
import 'package:pweb/providers/wallets.dart';
|
||||
|
||||
|
||||
// class WalletEditHeader extends StatefulWidget {
|
||||
// const WalletEditHeader({super.key});
|
||||
|
||||
// @override
|
||||
// State<WalletEditHeader> createState() => _WalletEditHeaderState();
|
||||
// }
|
||||
|
||||
// class _WalletEditHeaderState extends State<WalletEditHeader> {
|
||||
// bool _isEditing = false;
|
||||
// late TextEditingController _controller;
|
||||
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// _controller = TextEditingController();
|
||||
// }
|
||||
|
||||
// @override
|
||||
// void dispose() {
|
||||
// _controller.dispose();
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// final provider = context.watch<WalletsProvider>();
|
||||
// final currentWallet = provider.getWalletById(provider.wallets!.id);
|
||||
|
||||
|
||||
// if (wallet == null) {
|
||||
// return const SizedBox.shrink();
|
||||
// }
|
||||
|
||||
// final theme = Theme.of(context);
|
||||
// final dimensions = AppDimensions();
|
||||
|
||||
// if (!_isEditing) {
|
||||
// _controller.text = wallet.name;
|
||||
// }
|
||||
|
||||
// return Row(
|
||||
// spacing: 8,
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Icon(
|
||||
// iconForCurrencyType(wallet.currency),
|
||||
// color: theme.colorScheme.primary,
|
||||
// size: dimensions.iconSizeLarge,
|
||||
// ),
|
||||
|
||||
// Expanded(
|
||||
// child: !_isEditing
|
||||
// ? Row(
|
||||
// children: [
|
||||
// Expanded(
|
||||
// child: Text(
|
||||
// wallet.name,
|
||||
// style: theme.textTheme.headlineMedium!.copyWith(
|
||||
// fontWeight: FontWeight.bold,),
|
||||
// ),
|
||||
// ),
|
||||
// IconButton(
|
||||
// icon: const Icon(Icons.edit),
|
||||
// onPressed: () {
|
||||
// setState(() {
|
||||
// _isEditing = true;
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// )
|
||||
// : Row(
|
||||
// children: [
|
||||
// Expanded(
|
||||
// child: TextFormField(
|
||||
// controller: _controller,
|
||||
// decoration: const InputDecoration(
|
||||
// border: OutlineInputBorder(),
|
||||
// isDense: true,
|
||||
// hintText: 'Wallet name',
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// IconButton(
|
||||
// icon: const Icon(Icons.check),
|
||||
// color: theme.colorScheme.primary,
|
||||
// onPressed: () async {
|
||||
// provider.updateName(wallet.id, _controller.text);
|
||||
// await provider.updateWallet(wallet.copyWith(name: _controller.text));
|
||||
// ScaffoldMessenger.of(context).showSnackBar(
|
||||
// const SnackBar(content: Text('Wallet name saved')),
|
||||
// );
|
||||
// setState(() {
|
||||
// _isEditing = false;
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// IconButton(
|
||||
// icon: const Icon(Icons.close),
|
||||
// onPressed: () {
|
||||
// _controller.text = wallet.name;
|
||||
// setState(() {
|
||||
// _isEditing = false;
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
Reference in New Issue
Block a user