APY integrated and Account UI done
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user