APY integrated and Account UI done

This commit is contained in:
2026-03-19 13:23:34 +05:30
parent 8744e69ef7
commit fc495eca09
10 changed files with 617 additions and 492 deletions

View File

@@ -1,4 +1,3 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:kmobile/api/services/yojna_service.dart';
@@ -212,6 +211,29 @@ class _APYRegisterScreenState extends State<APYRegisterScreen> {
void _handleRegister() async {
if (_formKey.currentState!.validate()) {
final age = int.tryParse(_ageOfJoiningController.text) ?? 0;
if (age < 18 || age > 40) {
showDialog(
context: context,
barrierDismissible: false,
builder: (context) => AlertDialog(
title: const Text('Age Restriction'),
content: const Text(
'Age of joining must be between 18 and 40 years to register for APY.'),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context); // Close dialog
Navigator.popUntil(context, (route) => route.isFirst);
},
child: const Text('OK'),
),
],
),
);
return;
}
showDialog(
context: context,
barrierDismissible: false,