Edit Limit for beneficiaries and APY Register UI

This commit is contained in:
2026-03-13 18:17:03 +05:30
parent 7d39314d39
commit 075cb3aaad
6 changed files with 718 additions and 70 deletions

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:kmobile/data/models/user.dart';
import 'package:kmobile/features/yojna/screens/apy_register_screen.dart';
import 'package:kmobile/l10n/app_localizations.dart';
class APYScreen extends StatefulWidget {
@@ -18,6 +19,7 @@ class APYScreen extends StatefulWidget {
class _APYScreenState extends State<APYScreen> {
User? _selectedAccount;
List<User> _filteredUsers = [];
final _formKey = GlobalKey<FormState>();
@override
void initState() {
@@ -54,58 +56,132 @@ class _APYScreenState extends State<APYScreen> {
),
body: SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Card(
elevation: 2,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
l10n.apyDescription,
style: Theme.of(context).textTheme.titleMedium,
child: Form(
key: _formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Card(
elevation: 2,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
l10n.apyDescription,
style: Theme.of(context).textTheme.titleMedium,
),
),
),
),
const SizedBox(height: 16),
Card(
elevation: 2,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DropdownButtonFormField<User>(
value: _selectedAccount,
decoration: InputDecoration(
labelText: l10n.accountNumber,
border: const OutlineInputBorder(),
contentPadding: const EdgeInsets.symmetric(
vertical: 20, horizontal: 12),
const SizedBox(height: 16),
Card(
elevation: 2,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DropdownButtonFormField<User>(
value: _selectedAccount,
decoration: InputDecoration(
labelText: l10n.accountNumber,
border: const OutlineInputBorder(),
contentPadding: const EdgeInsets.symmetric(
vertical: 20, horizontal: 12),
),
items: _filteredUsers.map((user) {
return DropdownMenuItem<User>(
value: user,
child: Text(user.accountNo.toString()),
);
}).toList(),
onChanged: (User? newUser) {
setState(() {
_selectedAccount = newUser;
});
},
validator: (value) {
if (value == null) {
return l10n.accountNumberRequired;
}
return null;
},
),
items: _filteredUsers.map((user) {
return DropdownMenuItem<User>(
value: user,
child: Text(user.accountNo.toString()),
);
}).toList(),
onChanged: (User? newUser) {
setState(() {
_selectedAccount = newUser;
});
},
validator: (value) {
if (value == null) {
return l10n.accountNumberRequired;
}
return null;
},
),
],
],
),
),
),
),
],
const SizedBox(height: 24),
ElevatedButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
final mockData = {
"accountno": _selectedAccount?.accountNo ?? "50069506061",
"customerfirstname": "TAMANA",
"customermiddlename": "",
"customerlastname": "",
"availablebalance": "634000",
"customerdob": "06061998",
"emailid": "",
"gender": "F",
"married": "Y",
"nomineename": "shubham Kada",
"relationwithsubscriber": "S",
"mobilenumber": "",
"nomineeminor": "N",
"customerno": "30028309887",
"beneficaryofothersociatysecurityschemes": "N",
"whetherincometaxpayer": "N",
"customertitle": "02",
"aadharno": "",
"nameofspouse": "shubham kada",
"ageofjoining": "27",
"pensionamtoptedfor": "1000",
"montlycontributioncalculate": "90",
"collectionchannel": "1",
"subsequentContributionDebitDate": "02012026",
"secondnomineeminor": "N",
"secondnomineename": "shubham kad",
"secondrelationshipwithsubscriber": "",
"pincode": "176215",
"fatcacrsapplicable": "N",
"countryofbirth": "India",
"countryofcitizenship": "India",
"countryofresidencefortaxpurpose": "India",
"uspersonflag": "N",
"fatcadeclarationcount": "",
"documentevidencingcitizenshipflag": "",
"reasonfornoevidence": "",
"nameofdocumentforcitizenshipevidence": "",
"modeofcollection": "Transfer Voucher",
"contributionType": "C"
};
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => APYRegisterScreen(initialData: mockData),
),
);
}
},
style: ElevatedButton.styleFrom(
backgroundColor:
Theme.of(context).colorScheme.primaryContainer,
foregroundColor:
Theme.of(context).colorScheme.onPrimaryContainer,
minimumSize: const Size(double.infinity, 50),
elevation: 4,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
child: Text(
l10n.proceedButton,
style: const TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
),
),
],
),
),
),
);