Compare commits
3 Commits
83ad2b2e52
...
Acc_no_dro
| Author | SHA1 | Date | |
|---|---|---|---|
| 0c1d6fc718 | |||
| 1ad1cd07cc | |||
| c0e892341b |
@@ -53,7 +53,7 @@ class KMobile extends StatelessWidget {
|
|||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
// Handle different authentication states
|
// Handle different authentication states
|
||||||
if (state is AuthInitial || state is AuthLoading) {
|
if (state is AuthInitial || state is AuthLoading) {
|
||||||
return const _SplashScreen();
|
return const SplashScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(state is ShowBiometricPermission){
|
if(state is ShowBiometricPermission){
|
||||||
@@ -73,8 +73,8 @@ class KMobile extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Simple splash screens component
|
// Simple splash screens component
|
||||||
class _SplashScreen extends StatelessWidget {
|
class SplashScreen extends StatelessWidget {
|
||||||
const _SplashScreen();
|
const SplashScreen();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ class AppRoutes {
|
|||||||
// Route generator
|
// Route generator
|
||||||
static Route<dynamic> generateRoute(RouteSettings settings) {
|
static Route<dynamic> generateRoute(RouteSettings settings) {
|
||||||
switch (settings.name) {
|
switch (settings.name) {
|
||||||
|
case splash:
|
||||||
|
return MaterialPageRoute(builder: (_) => const SplashScreen());
|
||||||
case login:
|
case login:
|
||||||
return MaterialPageRoute(builder: (_) => const LoginScreen());
|
return MaterialPageRoute(builder: (_) => const LoginScreen());
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ class AuthRepository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<User?> getCurrentUser() async {
|
Future<User?> getCurrentUser() async {
|
||||||
final userJson = await _secureStorage.read(_userKey);
|
final userJson = await _secureStorage.read(_userKey);
|
||||||
if (userJson != null) {
|
if (userJson != null) {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class _AccountInfoScreen extends State<AccountInfoScreen>{
|
|||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
children: const [
|
children: const [
|
||||||
InfoRow(title: 'Account Number', value: '700127638009871'),
|
InfoRow(title: 'Account Number', value: '700127638009871'),
|
||||||
InfoRow(title: 'Nominee Customer No', value: '700127638009871'),
|
// InfoRow(title: 'Nominee Customer No', value: '700127638009871'),
|
||||||
InfoRow(title: 'SMS Service', value: 'Active'),
|
InfoRow(title: 'SMS Service', value: 'Active'),
|
||||||
InfoRow(title: 'Missed Call Service', value: 'Active'),
|
InfoRow(title: 'Missed Call Service', value: 'Active'),
|
||||||
InfoRow(title: 'Customer Number', value: '9000875272000212'),
|
InfoRow(title: 'Customer Number', value: '9000875272000212'),
|
||||||
|
|||||||
@@ -8,46 +8,96 @@ class AccountStatementScreen extends StatefulWidget {
|
|||||||
State<AccountStatementScreen> createState() => _AccountStatementScreen();
|
State<AccountStatementScreen> createState() => _AccountStatementScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AccountStatementScreen extends State<AccountStatementScreen>{
|
class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||||
DateTime? fromDate;
|
DateTime? fromDate;
|
||||||
DateTime? toDate;
|
DateTime? toDate;
|
||||||
final _amountRangeController = TextEditingController(text: "");
|
final _amountRangeController = TextEditingController(text: "");
|
||||||
final transactions = [
|
final transactions = [
|
||||||
{"desc": "Transfer From ICICI Bank subsidy", "amount": "+₹133.98", "type": "Cr", "time": "21-02-2024 13:09:30"},
|
{
|
||||||
{"desc": "Mobile recharge", "amount": "-₹299.00", "type": "Dr", "time": "21-02-2024 13:09:30"},
|
"desc": "Transfer From ICICI Bank subsidy",
|
||||||
{"desc": "NEFT received from Jaya Saha", "amount": "+₹987.80", "type": "Cr", "time": "21-02-2024 13:09:30"},
|
"amount": "+₹133.98",
|
||||||
{"desc": "Transfer From ICICI Bank subsidy", "amount": "+₹100.00", "type": "Cr", "time": "21-02-2024 13:09:30"},
|
"type": "Cr",
|
||||||
{"desc": "Transfer From ICICI Bank subsidy", "amount": "-₹100.00", "type": "Dr", "time": "21-02-2024 13:09:30"},
|
"time": "21-02-2024 13:09:30"
|
||||||
{"desc": "Transfer From ICICI Bank subsidy", "amount": "+₹100.00", "type": "Cr", "time": "21-02-2024 13:09:30"},
|
},
|
||||||
{"desc": "Transfer From ICICI Bank subsidy", "amount": "+₹100.00", "type": "Cr", "time": "21-02-2024 13:09:30"},
|
{
|
||||||
|
"desc": "Mobile recharge",
|
||||||
|
"amount": "-₹299.00",
|
||||||
|
"type": "Dr",
|
||||||
|
"time": "21-02-2024 13:09:30"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "NEFT received from Jaya Saha",
|
||||||
|
"amount": "+₹987.80",
|
||||||
|
"type": "Cr",
|
||||||
|
"time": "21-02-2024 13:09:30"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "Transfer From ICICI Bank subsidy",
|
||||||
|
"amount": "+₹100.00",
|
||||||
|
"type": "Cr",
|
||||||
|
"time": "21-02-2024 13:09:30"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "Transfer From ICICI Bank subsidy",
|
||||||
|
"amount": "-₹100.00",
|
||||||
|
"type": "Dr",
|
||||||
|
"time": "21-02-2024 13:09:30"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "Transfer From ICICI Bank subsidy",
|
||||||
|
"amount": "+₹100.00",
|
||||||
|
"type": "Cr",
|
||||||
|
"time": "21-02-2024 13:09:30"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"desc": "Transfer From ICICI Bank subsidy",
|
||||||
|
"amount": "+₹100.00",
|
||||||
|
"type": "Cr",
|
||||||
|
"time": "21-02-2024 13:09:30"
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
void _selectDate({required bool isFromDate}) async {
|
Future<void> _selectFromDate(BuildContext context) async {
|
||||||
final DateTime initial = isFromDate ? fromDate ?? DateTime.now() : toDate ?? fromDate ?? DateTime.now();
|
final DateTime now = DateTime.now();
|
||||||
|
|
||||||
final DateTime? picked = await showDatePicker(
|
final DateTime? picked = await showDatePicker(
|
||||||
context: context,
|
context: context,
|
||||||
initialDate: initial,
|
initialDate: fromDate ?? now,
|
||||||
firstDate: DateTime(2023),
|
firstDate: DateTime(2020), // or your app's start limit
|
||||||
lastDate: DateTime(2030),
|
lastDate: now, // No future date
|
||||||
);
|
);
|
||||||
|
|
||||||
if (picked != null) {
|
if (picked != null) {
|
||||||
setState(() {
|
setState(() {
|
||||||
if (isFromDate) {
|
fromDate = picked;
|
||||||
fromDate = picked;
|
toDate = null; // reset toDate when fromDate changes
|
||||||
if (toDate != null && toDate!.isBefore(fromDate!)) {
|
});
|
||||||
toDate = null; // reset invalid toDate
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (fromDate != null && picked.isBefore(fromDate!)) {
|
Future<void> _selectToDate(BuildContext context) async {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
if (fromDate == null) {
|
||||||
content: Text("To Date cannot be before From Date"),
|
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||||
));
|
content: Text('Please select From Date first'),
|
||||||
} else {
|
));
|
||||||
toDate = picked;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
final DateTime now = DateTime.now();
|
||||||
|
|
||||||
|
final DateTime lastAllowedDate = fromDate!.add(const Duration(days: 31));
|
||||||
|
final DateTime maxToDate = lastAllowedDate.isBefore(now) ? lastAllowedDate : now;
|
||||||
|
|
||||||
|
final DateTime? picked = await showDatePicker(
|
||||||
|
context: context,
|
||||||
|
initialDate: toDate ?? fromDate!,
|
||||||
|
firstDate: fromDate!, // 🔒 can't be before fromDate
|
||||||
|
lastDate: maxToDate, // 🔒 not more than 1 month or future
|
||||||
|
);
|
||||||
|
|
||||||
|
if (picked != null) {
|
||||||
|
setState(() {
|
||||||
|
toDate = picked;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,40 +118,76 @@ class _AccountStatementScreen extends State<AccountStatementScreen>{
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: IconButton(icon: const Icon(Symbols.arrow_back_ios_new),
|
leading: IconButton(
|
||||||
|
icon: const Icon(Symbols.arrow_back_ios_new),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},),
|
},
|
||||||
title: const Text('Account Statement', style: TextStyle(color: Colors.black,
|
),
|
||||||
fontWeight: FontWeight.w500),),
|
title: const Text(
|
||||||
|
'Account Statement',
|
||||||
|
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
actions: const [
|
actions: const [
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(right: 10.0),
|
padding: EdgeInsets.only(right: 10.0),
|
||||||
child: CircleAvatar(
|
child: CircleAvatar(
|
||||||
backgroundImage: AssetImage('assets/images/avatar.jpg'), // Replace with your image
|
backgroundImage: AssetImage('assets/images/avatar.jpg'),
|
||||||
|
// Replace with your image
|
||||||
radius: 20,
|
radius: 20,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
body: Padding(
|
body: Padding(
|
||||||
padding: const EdgeInsets.all(12.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const Text('Filters', style: TextStyle(fontSize: 17),),
|
const Text(
|
||||||
const SizedBox(height: 15,),
|
'Filters',
|
||||||
|
style: TextStyle(fontSize: 17),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: _buildFromDateSelector()),
|
Expanded(child: GestureDetector(
|
||||||
|
onTap: () => _selectFromDate(context),
|
||||||
|
child: buildDateBox("From Date", fromDate),
|
||||||
|
),),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(child: _buildToDateSelector()),
|
Expanded(child: GestureDetector(
|
||||||
|
onTap: () => _selectToDate(context),
|
||||||
|
child: buildDateBox("To Date", toDate),
|
||||||
|
),),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
_buildFilterBox(""),
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: _buildFilterBox(""),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 8,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 75,
|
||||||
|
child: ElevatedButton(
|
||||||
|
onPressed: () {},
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: Theme.of(context).primaryColor,
|
||||||
|
),
|
||||||
|
child: const Text(
|
||||||
|
'Go',
|
||||||
|
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w600),
|
||||||
|
)),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
const SizedBox(height: 35),
|
const SizedBox(height: 35),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@@ -115,54 +201,26 @@ class _AccountStatementScreen extends State<AccountStatementScreen>{
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildFromDateSelector() {
|
Widget buildDateBox(String label, DateTime? date) {
|
||||||
return GestureDetector(
|
return Container(
|
||||||
onTap: () => _selectDate(isFromDate: true),
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
||||||
child: Container(
|
decoration: BoxDecoration(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 14),
|
border: Border.all(color: Colors.grey),
|
||||||
decoration: BoxDecoration(
|
borderRadius: BorderRadius.circular(6),
|
||||||
border: Border.all(color: Colors.grey),
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
fromDate != null ? _formatDate(fromDate!) : "From Date",
|
|
||||||
style: const TextStyle(fontSize: 16),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Icon(Icons.arrow_drop_down),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
child: Row(
|
||||||
}
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
Widget _buildToDateSelector() {
|
Text(
|
||||||
return GestureDetector(
|
date != null ? _formatDate(date) : label,
|
||||||
onTap: () => _selectDate(isFromDate: false),
|
style: TextStyle(fontSize: 16,
|
||||||
child: Container(
|
color: date != null ? Colors.black: Colors.grey),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 14),
|
),
|
||||||
decoration: BoxDecoration(
|
const Icon(Icons.arrow_drop_down),
|
||||||
border: Border.all(color: Colors.grey),
|
],
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
toDate != null ? _formatDate(toDate!) : "To Date",
|
|
||||||
style: const TextStyle(fontSize: 16),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Icon(Icons.arrow_drop_down),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -206,7 +264,9 @@ class _AccountStatementScreen extends State<AccountStatementScreen>{
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: Text(txn['desc']!, style: const TextStyle(fontSize: 16))),
|
Expanded(
|
||||||
|
child:
|
||||||
|
Text(txn['desc']!, style: const TextStyle(fontSize: 16))),
|
||||||
Text(
|
Text(
|
||||||
"${txn['amount']} ${txn['type']}",
|
"${txn['amount']} ${txn['type']}",
|
||||||
style: TextStyle(color: amountColor, fontWeight: FontWeight.bold),
|
style: TextStyle(color: amountColor, fontWeight: FontWeight.bold),
|
||||||
@@ -217,4 +277,4 @@ class _AccountStatementScreen extends State<AccountStatementScreen>{
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:kmobile/features/auth/controllers/auth_cubit.dart';
|
import 'package:kmobile/features/auth/controllers/auth_cubit.dart';
|
||||||
|
import 'package:kmobile/security/secure_storage.dart';
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
|
|
||||||
import '../../../app.dart';
|
import '../../../app.dart';
|
||||||
|
|
||||||
class MPinScreen extends StatefulWidget {
|
class MPinScreen extends StatefulWidget {
|
||||||
@@ -64,15 +64,20 @@ class MPinScreenState extends State<MPinScreen> {
|
|||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
if (key == '<') {
|
if (key == '<') {
|
||||||
deleteDigit();
|
deleteDigit();
|
||||||
} else if (key == 'Enter') {
|
} else if (key == 'Enter') {
|
||||||
if (mPin.length == 4) {
|
if (mPin.length == 4) {
|
||||||
Navigator.push(
|
// String storedMpin = await SecureStorage().read("mpin");
|
||||||
context,
|
// if(!mounted) return;
|
||||||
MaterialPageRoute(builder: (context) => const NavigationScaffold()),
|
// if(storedMpin == mPin.join()) {
|
||||||
);
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => const NavigationScaffold()),
|
||||||
|
);
|
||||||
|
// }
|
||||||
} else {
|
} else {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
const SnackBar(content: Text("Please enter 4 digits")),
|
const SnackBar(content: Text("Please enter 4 digits")),
|
||||||
|
|||||||
144
lib/features/auth/screens/mpin_setup.dart
Normal file
144
lib/features/auth/screens/mpin_setup.dart
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:kmobile/features/auth/controllers/auth_cubit.dart';
|
||||||
|
import 'package:kmobile/features/auth/screens/mpin_setup_confirm.dart';
|
||||||
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
|
|
||||||
|
class MPinSetupScreen extends StatefulWidget {
|
||||||
|
const MPinSetupScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
MPinSetupScreenState createState() => MPinSetupScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class MPinSetupScreenState extends State<MPinSetupScreen> {
|
||||||
|
List<String> mPin = [];
|
||||||
|
|
||||||
|
void addDigit(String digit) {
|
||||||
|
if (mPin.length < 4) {
|
||||||
|
setState(() {
|
||||||
|
mPin.add(digit);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void deleteDigit() {
|
||||||
|
if (mPin.isNotEmpty) {
|
||||||
|
setState(() {
|
||||||
|
mPin.removeLast();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildMPinDots() {
|
||||||
|
return Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: List.generate(4, (index) {
|
||||||
|
return Container(
|
||||||
|
margin: const EdgeInsets.all(8),
|
||||||
|
width: 15,
|
||||||
|
height: 15,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: index < mPin.length ? Colors.black : Colors.grey[400],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildNumberPad() {
|
||||||
|
List<List<String>> keys = [
|
||||||
|
['1', '2', '3'],
|
||||||
|
['4', '5', '6'],
|
||||||
|
['7', '8', '9'],
|
||||||
|
['Enter', '0', '<']
|
||||||
|
];
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
children: keys.map((row) {
|
||||||
|
return Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: row.map((key) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
if (key == '<') {
|
||||||
|
deleteDigit();
|
||||||
|
} else if (key == 'Enter') {
|
||||||
|
if (mPin.length == 4) {
|
||||||
|
Navigator.of(context).push(
|
||||||
|
MaterialPageRoute(builder: (context) => MPinSetupConfirmScreen(mPin: mPin,)),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(content: Text("Please enter 4 digits")),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else if (key.isNotEmpty) {
|
||||||
|
addDigit(key);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: 70,
|
||||||
|
height: 70,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: Colors.grey[200],
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: key == 'Enter' ? const Icon(Symbols.check) : Text(
|
||||||
|
key == '<' ? '⌫' : key,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: key == 'Enter' ?
|
||||||
|
FontWeight.normal : FontWeight.normal,
|
||||||
|
color: key == 'Enter' ? Colors.blue : Colors.black,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final cubit = context.read<AuthCubit>();
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
body: SafeArea(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
const Spacer(),
|
||||||
|
// Logo
|
||||||
|
const FlutterLogo(size: 100),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
const Text(
|
||||||
|
"Enter your mPIN",
|
||||||
|
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
buildMPinDots(),
|
||||||
|
const Spacer(),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
TextButton(onPressed: () {
|
||||||
|
cubit.authenticateBiometric();
|
||||||
|
}, child: const Text("Try another way")),
|
||||||
|
TextButton(onPressed: () {}, child: const Text("Register?")),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
buildNumberPad(),
|
||||||
|
const Spacer(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
154
lib/features/auth/screens/mpin_setup_confirm.dart
Normal file
154
lib/features/auth/screens/mpin_setup_confirm.dart
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:kmobile/features/auth/controllers/auth_cubit.dart';
|
||||||
|
import 'package:kmobile/security/secure_storage.dart';
|
||||||
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
|
import '../../../app.dart';
|
||||||
|
|
||||||
|
class MPinSetupConfirmScreen extends StatefulWidget {
|
||||||
|
final List<String> mPin;
|
||||||
|
const MPinSetupConfirmScreen({super.key, required this.mPin});
|
||||||
|
|
||||||
|
@override
|
||||||
|
MPinSetupConfirmScreenState createState() => MPinSetupConfirmScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class MPinSetupConfirmScreenState extends State<MPinSetupConfirmScreen> {
|
||||||
|
List<String> mPin = [];
|
||||||
|
|
||||||
|
void addDigit(String digit) {
|
||||||
|
if (mPin.length < 4) {
|
||||||
|
setState(() {
|
||||||
|
mPin.add(digit);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void deleteDigit() {
|
||||||
|
if (mPin.isNotEmpty) {
|
||||||
|
setState(() {
|
||||||
|
mPin.removeLast();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildMPinDots() {
|
||||||
|
return Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: List.generate(4, (index) {
|
||||||
|
return Container(
|
||||||
|
margin: const EdgeInsets.all(8),
|
||||||
|
width: 15,
|
||||||
|
height: 15,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: index < mPin.length ? Colors.black : Colors.grey[400],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildNumberPad() {
|
||||||
|
List<List<String>> keys = [
|
||||||
|
['1', '2', '3'],
|
||||||
|
['4', '5', '6'],
|
||||||
|
['7', '8', '9'],
|
||||||
|
['Enter', '0', '<']
|
||||||
|
];
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
children: keys.map((row) {
|
||||||
|
return Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: row.map((key) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
if (key == '<') {
|
||||||
|
deleteDigit();
|
||||||
|
} else if (key == 'Enter') {
|
||||||
|
if (mPin.length == 4 && mPin.join() == widget.mPin.join()) {
|
||||||
|
|
||||||
|
await SecureStorage().write("mpin", mPin.join());
|
||||||
|
await SharedPreferences.getInstance()
|
||||||
|
.then((prefs) => prefs.setBool('mpin_set', true));
|
||||||
|
if(!mounted) return;
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) => const NavigationScaffold()),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(content: Text("Please enter 4 digits")),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else if (key.isNotEmpty) {
|
||||||
|
addDigit(key);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: 70,
|
||||||
|
height: 70,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: Colors.grey[200],
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: key == 'Enter' ? const Icon(Symbols.check) : Text(
|
||||||
|
key == '<' ? '⌫' : key,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: key == 'Enter' ?
|
||||||
|
FontWeight.normal : FontWeight.normal,
|
||||||
|
color: key == 'Enter' ? Colors.blue : Colors.black,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final cubit = context.read<AuthCubit>();
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
body: SafeArea(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
const Spacer(),
|
||||||
|
// Logo
|
||||||
|
const FlutterLogo(size: 100),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
const Text(
|
||||||
|
"Enter your mPIN",
|
||||||
|
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
buildMPinDots(),
|
||||||
|
const Spacer(),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
TextButton(onPressed: () {
|
||||||
|
cubit.authenticateBiometric();
|
||||||
|
}, child: const Text("Try another way")),
|
||||||
|
TextButton(onPressed: () {}, child: const Text("Register?")),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
buildNumberPad(),
|
||||||
|
const Spacer(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen>{
|
|||||||
final _formKey = GlobalKey<FormState>();
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
final TextEditingController accountNumberController = TextEditingController();
|
final TextEditingController accountNumberController = TextEditingController();
|
||||||
|
final TextEditingController confirmAccountNumberController = TextEditingController();
|
||||||
final TextEditingController nameController = TextEditingController();
|
final TextEditingController nameController = TextEditingController();
|
||||||
final TextEditingController bankNameController = TextEditingController();
|
final TextEditingController bankNameController = TextEditingController();
|
||||||
final TextEditingController branchNameController = TextEditingController();
|
final TextEditingController branchNameController = TextEditingController();
|
||||||
@@ -109,6 +110,7 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen>{
|
|||||||
borderSide: BorderSide(color: Colors.black, width: 2),
|
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
obscureText: true,
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
textInputAction: TextInputAction.next,
|
textInputAction: TextInputAction.next,
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
@@ -119,6 +121,36 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen>{
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
|
// Confirm Account Number
|
||||||
|
TextFormField(
|
||||||
|
controller: confirmAccountNumberController,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
labelText: 'Confirm Account Number',
|
||||||
|
// prefixIcon: Icon(Icons.person),
|
||||||
|
border: OutlineInputBorder(),
|
||||||
|
isDense: true,
|
||||||
|
filled: true,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.black),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
textInputAction: TextInputAction.next,
|
||||||
|
validator: (value) {
|
||||||
|
if (value == null || value.isEmpty) {
|
||||||
|
return 'Re-enter account number';
|
||||||
|
}
|
||||||
|
if (value != accountNumberController.text) {
|
||||||
|
return 'Account numbers do not match';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 24),
|
||||||
TextFormField(
|
TextFormField(
|
||||||
controller: nameController,
|
controller: nameController,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) => const AccountInfoScreen()));
|
builder: (context) => const AccountInfoScreen()));
|
||||||
}),
|
}),
|
||||||
_buildQuickLink(Symbols.receipt_long, "Account \n History",
|
_buildQuickLink(Symbols.receipt_long, "Account \n Statement",
|
||||||
() {
|
() {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
@@ -229,13 +229,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
builder: (context) =>
|
builder: (context) =>
|
||||||
const AccountStatementScreen()));
|
const AccountStatementScreen()));
|
||||||
}),
|
}),
|
||||||
_buildQuickLink(Symbols.checkbook, "Handle \n Cheque", () {
|
// _buildQuickLink(Symbols.checkbook, "Handle \n Cheque", () {
|
||||||
Navigator.push(
|
// Navigator.push(
|
||||||
context,
|
// context,
|
||||||
MaterialPageRoute(
|
// MaterialPageRoute(
|
||||||
builder: (context) =>
|
// builder: (context) =>
|
||||||
const ChequeManagementScreen()));
|
// const ChequeManagementScreen()));
|
||||||
}),
|
// }),
|
||||||
_buildQuickLink(Icons.group, "Manage \n Beneficiary", () {
|
_buildQuickLink(Icons.group, "Manage \n Beneficiary", () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
|
|||||||
@@ -98,6 +98,17 @@ class _FundTransferScreen extends State<FundTransferScreen> {
|
|||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
|
const Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text('Debit from:'),
|
||||||
|
Text(
|
||||||
|
'0300015678903456',
|
||||||
|
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
const Text('Enter Amount', style: TextStyle(fontSize: 20)),
|
const Text('Enter Amount', style: TextStyle(fontSize: 20)),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Container(
|
Container(
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_swipe_button/flutter_swipe_button.dart';
|
import 'package:flutter_swipe_button/flutter_swipe_button.dart';
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
|
|
||||||
|
import '../../fund_transfer/screens/transaction_pin_screen.dart';
|
||||||
|
|
||||||
class QuickPayOutsideBankScreen extends StatefulWidget {
|
class QuickPayOutsideBankScreen extends StatefulWidget {
|
||||||
const QuickPayOutsideBankScreen({super.key});
|
const QuickPayOutsideBankScreen({super.key});
|
||||||
|
|
||||||
@@ -15,6 +17,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
|
|
||||||
// Controllers
|
// Controllers
|
||||||
final accountNumberController = TextEditingController();
|
final accountNumberController = TextEditingController();
|
||||||
|
final confirmAccountNumberController = TextEditingController();
|
||||||
final nameController = TextEditingController();
|
final nameController = TextEditingController();
|
||||||
final bankNameController = TextEditingController();
|
final bankNameController = TextEditingController();
|
||||||
final branchNameController = TextEditingController();
|
final branchNameController = TextEditingController();
|
||||||
@@ -30,6 +33,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
void dispose() {
|
void dispose() {
|
||||||
// Dispose controllers
|
// Dispose controllers
|
||||||
accountNumberController.dispose();
|
accountNumberController.dispose();
|
||||||
|
confirmAccountNumberController.dispose();
|
||||||
nameController.dispose();
|
nameController.dispose();
|
||||||
bankNameController.dispose();
|
bankNameController.dispose();
|
||||||
branchNameController.dispose();
|
branchNameController.dispose();
|
||||||
@@ -50,7 +54,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
title: const Text(
|
title: const Text(
|
||||||
'Quick Pay - Other Bank',
|
'Quick Pay - Outside Bank',
|
||||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
@@ -71,7 +75,17 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
key: _formKey,
|
key: _formKey,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 25),
|
const SizedBox(height: 10),
|
||||||
|
const Row(
|
||||||
|
children: [
|
||||||
|
Text('Debit from:'),
|
||||||
|
Text(
|
||||||
|
'0300015678903456',
|
||||||
|
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
TextFormField(
|
TextFormField(
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Account Number',
|
labelText: 'Account Number',
|
||||||
@@ -88,6 +102,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
),
|
),
|
||||||
controller: accountNumberController,
|
controller: accountNumberController,
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
|
obscureText: true,
|
||||||
textInputAction: TextInputAction.next,
|
textInputAction: TextInputAction.next,
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value == null || value.isEmpty) {
|
if (value == null || value.isEmpty) {
|
||||||
@@ -98,6 +113,35 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 24),
|
||||||
|
TextFormField(
|
||||||
|
controller: confirmAccountNumberController,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
labelText: 'Confirm Account Number',
|
||||||
|
// prefixIcon: Icon(Icons.person),
|
||||||
|
border: OutlineInputBorder(),
|
||||||
|
isDense: true,
|
||||||
|
filled: true,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.black),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
textInputAction: TextInputAction.next,
|
||||||
|
validator: (value) {
|
||||||
|
if (value == null || value.isEmpty) {
|
||||||
|
return 'Re-enter account number';
|
||||||
|
}
|
||||||
|
if (value != accountNumberController.text) {
|
||||||
|
return 'Account numbers do not match';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
const SizedBox(height: 25),
|
const SizedBox(height: 25),
|
||||||
TextFormField(
|
TextFormField(
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
@@ -297,11 +341,10 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
Expanded(child: buildTransactionModeSelector()),
|
Expanded(child: buildTransactionModeSelector()),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
const SizedBox(height: 45),
|
const SizedBox(height: 45),
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: SwipeButton.expand(
|
child: SwipeButton.expand(
|
||||||
thumb: const Icon(
|
thumb: const Icon(
|
||||||
Icons.arrow_forward,
|
Icons.arrow_forward,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
@@ -312,20 +355,26 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
height: 56,
|
height: 56,
|
||||||
child: const Text(
|
child: const Text(
|
||||||
"Swipe to Pay",
|
"Swipe to Pay",
|
||||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
style:
|
||||||
|
TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
onSwipe: () {
|
onSwipe: () {
|
||||||
if (_formKey.currentState!.validate()) {
|
if (_formKey.currentState!.validate()) {
|
||||||
// Perform payment logic
|
// Perform payment logic
|
||||||
final selectedMode = transactionModes[selectedTransactionIndex];
|
final selectedMode =
|
||||||
|
transactionModes[selectedTransactionIndex];
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(content: Text('Paying via $selectedMode...')),
|
SnackBar(
|
||||||
|
content: Text('Paying via $selectedMode...')),
|
||||||
);
|
);
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) =>
|
||||||
|
const TransactionPinScreen()));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)),
|
||||||
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -351,7 +400,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
|||||||
color: isSelected ? Colors.blue[200] : Colors.white,
|
color: isSelected ? Colors.blue[200] : Colors.white,
|
||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius: BorderRadius.circular(5),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: isSelected? Colors.blue : Colors.grey,
|
color: isSelected ? Colors.blue : Colors.grey,
|
||||||
width: isSelected ? 0 : 1.2,
|
width: isSelected ? 0 : 1.2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_swipe_button/flutter_swipe_button.dart';
|
import 'package:flutter_swipe_button/flutter_swipe_button.dart';
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
|
|
||||||
|
import '../../fund_transfer/screens/transaction_pin_screen.dart';
|
||||||
|
|
||||||
class QuickPayWithinBankScreen extends StatefulWidget {
|
class QuickPayWithinBankScreen extends StatefulWidget {
|
||||||
const QuickPayWithinBankScreen({super.key});
|
const QuickPayWithinBankScreen({super.key});
|
||||||
|
|
||||||
@@ -13,6 +15,7 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
|||||||
final _formKey = GlobalKey<FormState>();
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
final TextEditingController accountNumberController = TextEditingController();
|
final TextEditingController accountNumberController = TextEditingController();
|
||||||
|
final TextEditingController confirmAccountNumberController = TextEditingController();
|
||||||
final TextEditingController nameController = TextEditingController();
|
final TextEditingController nameController = TextEditingController();
|
||||||
final TextEditingController amountController = TextEditingController();
|
final TextEditingController amountController = TextEditingController();
|
||||||
|
|
||||||
@@ -48,7 +51,17 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
|||||||
key: _formKey,
|
key: _formKey,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 25),
|
const SizedBox(height: 10),
|
||||||
|
const Row(
|
||||||
|
children: [
|
||||||
|
Text('Debit from:'),
|
||||||
|
Text(
|
||||||
|
'0300015678903456',
|
||||||
|
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
TextFormField(
|
TextFormField(
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Account Number',
|
labelText: 'Account Number',
|
||||||
@@ -65,6 +78,7 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
|||||||
),
|
),
|
||||||
controller: accountNumberController,
|
controller: accountNumberController,
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
|
obscureText: true,
|
||||||
textInputAction: TextInputAction.next,
|
textInputAction: TextInputAction.next,
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value == null || value.isEmpty) {
|
if (value == null || value.isEmpty) {
|
||||||
@@ -85,6 +99,35 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
|||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
const SizedBox(height: 25),
|
const SizedBox(height: 25),
|
||||||
|
TextFormField(
|
||||||
|
controller: confirmAccountNumberController,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
labelText: 'Confirm Account Number',
|
||||||
|
// prefixIcon: Icon(Icons.person),
|
||||||
|
border: OutlineInputBorder(),
|
||||||
|
isDense: true,
|
||||||
|
filled: true,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.black),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.black, width: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
textInputAction: TextInputAction.next,
|
||||||
|
validator: (value) {
|
||||||
|
if (value == null || value.isEmpty) {
|
||||||
|
return 'Re-enter account number';
|
||||||
|
}
|
||||||
|
if (value != accountNumberController.text) {
|
||||||
|
return 'Account numbers do not match';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 24),
|
||||||
TextFormField(
|
TextFormField(
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Name',
|
labelText: 'Name',
|
||||||
@@ -170,6 +213,10 @@ class _QuickPayWithinBankScreen extends State<QuickPayWithinBankScreen> {
|
|||||||
const SnackBar(
|
const SnackBar(
|
||||||
content: Text('Processing Payment...')),
|
content: Text('Processing Payment...')),
|
||||||
);
|
);
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => const TransactionPinScreen()));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user