Cheque (service & screens) & Account

This commit is contained in:
2026-02-16 11:54:34 +05:30
parent dc51690292
commit 30296be75a
16 changed files with 815 additions and 73 deletions

View File

@@ -0,0 +1,175 @@
import 'package:flutter/material.dart'; // Keep if User model is generic
import 'package:kmobile/features/account_opening/screens/fd_screen.dart';
import 'package:kmobile/features/account_opening/screens/loan_screen.dart';
import 'package:kmobile/features/account_opening/screens/rd_screen.dart';
import 'package:kmobile/features/account_opening/screens/td_screen.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import '../../../l10n/app_localizations.dart';
class AccountOpeningScreen extends StatefulWidget {
const AccountOpeningScreen({
super.key,
});
@override
State<AccountOpeningScreen> createState() => _AccountOpeningScreenState();
}
class _AccountOpeningScreenState extends State<AccountOpeningScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text(
"Account Opening",
),
centerTitle: false,
),
body: Stack(
children: [
Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
child: AccountOpeningCardTile(
icon: Symbols.savings,
label: "Fixed Deposit (FD)",
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const FdScreen(
),
),
);
},
),
),
Expanded(
child: AccountOpeningCardTile(
icon: Symbols.currency_rupee,
label: "Term Deposit",
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const TermDepositScreen()
),
);
},
),
),
Expanded(
child: AccountOpeningCardTile(
icon: Symbols.account_balance,
label: AppLocalizations.of(context).recurringDeposit,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const RecurringDepositScreen() ),
);
},
),
),
Expanded(
child: AccountOpeningCardTile(
icon: Symbols.credit_card,
label: "Request Loan",
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const LoanScreen()
),
);
},
),
),
],
),
),
IgnorePointer(
child: Center(
child: Opacity(
opacity: 0.07,
child: ClipOval(
child: Image.asset(
'assets/images/logo.png',
width: 200,
height: 200,
),
),
),
),
),
],
),
);
}
}
class AccountOpeningCardTile extends StatelessWidget {
final IconData icon;
final String label;
final VoidCallback onTap;
final bool disable;
const AccountOpeningCardTile({
super.key,
required this.icon,
required this.label,
required this.onTap,
this.disable = false,
});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Card(
margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0),
),
elevation: 4,
child: InkWell(
onTap:
disable ? null : onTap,
borderRadius: BorderRadius.circular(12.0),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 24.0, horizontal: 16.0),
child: Center(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
icon,
size: 48,
color: disable
? theme.disabledColor
: theme.colorScheme.primary,
),
const SizedBox(height: 12),
Text(
label,
textAlign: TextAlign.center,
style: theme.textTheme.titleLarge?.copyWith(
fontWeight: FontWeight.bold,
color: disable
? theme.disabledColor
: theme.colorScheme.onSurface,
),
),
],
),
),
),
),
),
);
}
}

View File

@@ -0,0 +1,244 @@
import 'package:flutter/material.dart';
import 'package:kmobile/features/account_opening/screens/interest_rates_screen.dart';
class FdScreen extends StatefulWidget {
const FdScreen({super.key});
@override
State<FdScreen> createState() => _FdScreenState();
}
class _FdScreenState extends State<FdScreen> {
final TextEditingController _debitAccountController = TextEditingController();
final TextEditingController _amountController = TextEditingController();
final TextEditingController _yearsController = TextEditingController();
final TextEditingController _monthsController = TextEditingController();
final TextEditingController _daysController = TextEditingController();
String _rateOfInterest = "N/A";
String _maturityDate = "N/A";
String _maturityAmount = "N/A";
@override
void dispose() {
_debitAccountController.dispose();
_amountController.dispose();
_yearsController.dispose();
_monthsController.dispose();
_daysController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Fixed Deposit (FD)'),
),
body: SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Explanation Tile
Card(
margin: const EdgeInsets.only(bottom: 20),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Earn more on your savings with a simple, secure Fixed Deposit.',
style: Theme.of(context).textTheme.bodyMedium,
),
],
),
),
),
// Debit Account Number
TextFormField(
controller: _debitAccountController,
decoration: const InputDecoration(
labelText: 'Debit Account Number',
border: OutlineInputBorder(),
),
keyboardType: TextInputType.number,
),
const SizedBox(height: 20),
// Enter Amount
TextFormField(
controller: _amountController,
decoration: const InputDecoration(
labelText: 'Enter Amount',
border: OutlineInputBorder(),
prefixText: ''
),
keyboardType: TextInputType.number,
),
const SizedBox(height: 20),
// Duration and Interest Rates Link
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Duration',
style: Theme.of(context).textTheme.titleLarge,
),
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const InterestRatesScreen()),
);
},
child: Text(
'Interest Rates',
style: Theme.of(context).textTheme.titleSmall
),
),
],
),
const SizedBox(height: 10),
// Duration TextBoxes
Row(
children: [
Expanded(
child: TextFormField(
controller: _yearsController,
decoration: const InputDecoration(
labelText: 'Years',
border: OutlineInputBorder(),
),
keyboardType: TextInputType.number,
),
),
const SizedBox(width: 10),
Expanded(
child: TextFormField(
controller: _monthsController,
decoration: const InputDecoration(
labelText: 'Months',
border: OutlineInputBorder(),
),
keyboardType: TextInputType.number,
),
),
const SizedBox(width: 10),
Expanded(
child: TextFormField(
controller: _daysController,
decoration: const InputDecoration(
labelText: 'Days',
border: OutlineInputBorder(),
),
keyboardType: TextInputType.number,
),
),
],
),
const SizedBox(height: 20),
// Rate of Interest and Maturity Date Display
Row(
children: [
Expanded(
child: Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Rate of Interest',
style: Theme.of(context).textTheme.bodySmall,
),
const SizedBox(height: 5),
Text(
_rateOfInterest,
style: Theme.of(context).textTheme.headlineSmall,
),
],
),
),
),
),
const SizedBox(width: 10),
Expanded(
child: Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Maturity Date',
style: Theme.of(context).textTheme.bodySmall,
),
const SizedBox(height: 5),
Text(
_maturityDate,
style: Theme.of(context).textTheme.headlineSmall,
),
],
),
),
),
),
],
),
const SizedBox(height: 10),
// Maturity Amount Display
Row(
children: [
Expanded(
child: Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Maturity Amount',
style: Theme.of(context).textTheme.bodySmall,
),
const SizedBox(height: 5),
Text(
_maturityAmount,
style: Theme.of(context).textTheme.headlineSmall,
),
],
),
),
),
),
],
),
const SizedBox(height: 30),
// Proceed Button
Center(
child: ElevatedButton(
onPressed: () {
// TODO: Implement proceed logic
},
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 15),
),
child: const Text(
'Proceed',
style: TextStyle(fontSize: 18),
),
),
),
],
),
),
);
}
}

View File

@@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
class InterestRatesScreen extends StatelessWidget {
const InterestRatesScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Interest Rates'),
),
body: const Center(
child: Text('This page will display a table of interest rates.'),
),
);
}
}

View File

@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
class LoanScreen extends StatelessWidget {
const LoanScreen({
super.key,
});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Request Loan"),
),
body: const Center(
child: Text("Loan Account"),
),
);
}
}

View File

@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
class RecurringDepositScreen extends StatelessWidget {
const RecurringDepositScreen({
super.key,
});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Recurring Deposit"),
),
body: const Center(
child: Text("Recurring Deposit"),
),
);
}
}

View File

@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
class TermDepositScreen extends StatelessWidget {
const TermDepositScreen({
super.key,
});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Term Deposit (TD)"),
),
body: const Center(
child: Text("Term Deposit (TD)"),
),
);
}
}