fund-transfer-screens
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:kmobile/features/cheque/screens/cheque_management_screen.dart';
|
||||
import 'package:kmobile/features/customer_info/screens/customer_info_screen.dart';
|
||||
import 'package:kmobile/features/beneficiaries/screens/manage_beneficiaries_screen.dart';
|
||||
import 'package:kmobile/features/enquiry/screens/enquiry_screen.dart';
|
||||
import 'package:kmobile/features/fund_transfer/screens/fund_transfer_beneficiary_screen.dart';
|
||||
import 'package:kmobile/features/quick_pay/screens/quick_pay_screen.dart';
|
||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||
|
||||
@@ -119,7 +120,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
builder: (context) => const QuickPayScreen()));
|
||||
}),
|
||||
_buildQuickLink(Symbols.send_money, "Fund \n Transfer",
|
||||
() => print("")),
|
||||
() {
|
||||
Navigator.push(context, MaterialPageRoute(
|
||||
builder: (context) => const FundTransferBeneficiaryScreen()));
|
||||
}),
|
||||
_buildQuickLink(Symbols.server_person, "Account \n Info",
|
||||
(){
|
||||
Navigator.push(context, MaterialPageRoute(
|
||||
|
@@ -0,0 +1,96 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kmobile/features/beneficiaries/screens/add_beneficiary_screen.dart';
|
||||
import 'package:kmobile/features/fund_transfer/screens/fund_transfer_screen.dart';
|
||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||
|
||||
class FundTransferBeneficiaryScreen extends StatefulWidget {
|
||||
const FundTransferBeneficiaryScreen({super.key});
|
||||
|
||||
@override
|
||||
State<FundTransferBeneficiaryScreen> createState() => _FundTransferBeneficiaryScreen();
|
||||
}
|
||||
|
||||
class _FundTransferBeneficiaryScreen extends State<FundTransferBeneficiaryScreen>{
|
||||
final List<Map<String, String>> beneficiaries = [
|
||||
{
|
||||
'bank': 'State Bank Of India',
|
||||
'name': 'Trina Bakshi',
|
||||
},
|
||||
{
|
||||
'bank': 'State Bank Of India',
|
||||
'name': 'Sheetal Rao',
|
||||
},
|
||||
{
|
||||
'bank': 'Punjab National Bank',
|
||||
'name': 'Manoj Kumar',
|
||||
},
|
||||
{
|
||||
'bank': 'State Bank Of India',
|
||||
'name': 'Rohit Mehra',
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: IconButton(icon: const Icon(Symbols.arrow_back_ios_new),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},),
|
||||
title: const Text('Fund Transfer - Beneficiary', style: TextStyle(color: Colors.black,
|
||||
fontWeight: FontWeight.w500),),
|
||||
centerTitle: false,
|
||||
actions: const [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 10.0),
|
||||
child: CircleAvatar(
|
||||
backgroundImage: AssetImage('assets/images/avatar.jpg'), // Replace with your image
|
||||
radius: 20,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ListView.builder(
|
||||
itemCount: beneficiaries.length,
|
||||
itemBuilder: (context, index) {
|
||||
final beneficiary = beneficiaries[index];
|
||||
return ListTile(
|
||||
leading: const CircleAvatar(
|
||||
backgroundColor: Colors.blue,
|
||||
child: Text('A')),
|
||||
title: Text(beneficiary['name']!),
|
||||
subtitle: Text(beneficiary['bank']!),
|
||||
trailing: IconButton(
|
||||
icon: const Icon(Symbols.arrow_right, size: 20,),
|
||||
onPressed: () {
|
||||
// Delete action
|
||||
},
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(context, MaterialPageRoute(
|
||||
builder: (context) => const FundTransferScreen()));
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
floatingActionButton: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8.0),
|
||||
child: FloatingActionButton(
|
||||
onPressed: () {
|
||||
Navigator.push(context, MaterialPageRoute(
|
||||
builder: (context) => const AddBeneficiaryScreen()));
|
||||
},
|
||||
backgroundColor: Colors.grey[300],
|
||||
foregroundColor: Colors.blue[900],
|
||||
elevation: 5,
|
||||
child: const Icon(Icons.add),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
130
lib/features/fund_transfer/screens/fund_transfer_screen.dart
Normal file
130
lib/features/fund_transfer/screens/fund_transfer_screen.dart
Normal file
@@ -0,0 +1,130 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||
|
||||
class FundTransferScreen extends StatefulWidget {
|
||||
const FundTransferScreen({super.key});
|
||||
|
||||
@override
|
||||
State<FundTransferScreen> createState() => _FundTransferScreen();
|
||||
}
|
||||
|
||||
class _FundTransferScreen extends State<FundTransferScreen> {
|
||||
String amount = "";
|
||||
|
||||
void onKeyTap(String key) {
|
||||
setState(() {
|
||||
if (key == 'back') {
|
||||
if (amount.isNotEmpty) {
|
||||
amount = amount.substring(0, amount.length - 1);
|
||||
}
|
||||
} else if (key == 'done') {
|
||||
if (kDebugMode) {
|
||||
print('Amount entered: $amount');
|
||||
}
|
||||
} else {
|
||||
amount += key;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Widget buildKey(String value) {
|
||||
if (value == 'done') {
|
||||
return GestureDetector(
|
||||
onTap: () => onKeyTap(value),
|
||||
child: const Icon(Symbols.check, size: 30),
|
||||
);
|
||||
} else if (value == 'back') {
|
||||
return GestureDetector(
|
||||
onTap: () => onKeyTap(value),
|
||||
child: const Icon(Symbols.backspace, size: 30)
|
||||
);
|
||||
} else {
|
||||
return GestureDetector(
|
||||
onTap: () => onKeyTap(value),
|
||||
child: Center(
|
||||
child: Text(value,
|
||||
style: const TextStyle(fontSize: 24, color: Colors.black)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
final keys = [
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
'8',
|
||||
'9',
|
||||
'done',
|
||||
'0',
|
||||
'back',
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: IconButton(
|
||||
icon: const Icon(Symbols.arrow_back_ios_new),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
title: const Text(
|
||||
'Fund Transfer',
|
||||
style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500),
|
||||
),
|
||||
centerTitle: false,
|
||||
actions: const [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 10.0),
|
||||
child: CircleAvatar(
|
||||
backgroundImage: AssetImage('assets/images/avatar.jpg'),
|
||||
// Replace with your image
|
||||
radius: 20,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 40),
|
||||
const Text('Enter Amount', style: TextStyle(fontSize: 20)),
|
||||
const SizedBox(height: 20),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey.shade200,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Text(
|
||||
amount.isEmpty ? "0" : amount,
|
||||
style: const TextStyle(fontSize: 32, fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
Expanded(
|
||||
child: GridView.builder(
|
||||
itemCount: keys.length,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3,
|
||||
childAspectRatio: 1.2,
|
||||
mainAxisSpacing: 12,
|
||||
crossAxisSpacing: 12,
|
||||
),
|
||||
itemBuilder: (_, index) => buildKey(keys[index]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user