account_number_selection functionality
This commit is contained in:
parent
7832a9372f
commit
83ad2b2e52
BIN
assets/fonts/Sriracha-Regular.ttf
Normal file
BIN
assets/fonts/Sriracha-Regular.ttf
Normal file
Binary file not shown.
@ -9,6 +9,7 @@ import 'package:kmobile/features/fund_transfer/screens/fund_transfer_beneficiary
|
|||||||
import 'package:kmobile/features/quick_pay/screens/quick_pay_screen.dart';
|
import 'package:kmobile/features/quick_pay/screens/quick_pay_screen.dart';
|
||||||
import 'package:kmobile/src/preferences/preference.dart';
|
import 'package:kmobile/src/preferences/preference.dart';
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
class DashboardScreen extends StatefulWidget {
|
class DashboardScreen extends StatefulWidget {
|
||||||
const DashboardScreen({super.key});
|
const DashboardScreen({super.key});
|
||||||
@ -20,13 +21,42 @@ class DashboardScreen extends StatefulWidget {
|
|||||||
class _DashboardScreenState extends State<DashboardScreen> {
|
class _DashboardScreenState extends State<DashboardScreen> {
|
||||||
// Mock data for transactions
|
// Mock data for transactions
|
||||||
final List<Map<String, String>> transactions = [
|
final List<Map<String, String>> transactions = [
|
||||||
{'name': 'Raj Kumar', 'amount': '₹1,000', 'date': '09 March, 2025 16:04', 'type': 'in'},
|
{
|
||||||
{'name': 'Sunita Joshi', 'amount': '₹1,45,000', 'date': '07 March, 2025 16:04', 'type': 'out'},
|
'name': 'Raj Kumar',
|
||||||
{'name': 'Manoj Singh', 'amount': '₹2,400', 'date': '07 March, 2025 16:04', 'type': 'in'},
|
'amount': '₹1,000',
|
||||||
{'name': 'Raj Kumar', 'amount': '₹11,500', 'date': '09 March, 2025 16:04', 'type': 'in'},
|
'date': '09 March, 2025 16:04',
|
||||||
|
'type': 'in'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'Sunita Joshi',
|
||||||
|
'amount': '₹1,45,000',
|
||||||
|
'date': '07 March, 2025 16:04',
|
||||||
|
'type': 'out'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'Manoj Singh',
|
||||||
|
'amount': '₹2,400',
|
||||||
|
'date': '07 March, 2025 16:04',
|
||||||
|
'type': 'in'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'Raj Kumar',
|
||||||
|
'amount': '₹11,500',
|
||||||
|
'date': '09 March, 2025 16:04',
|
||||||
|
'type': 'in'
|
||||||
|
},
|
||||||
{'name': 'Manoj Singh', 'amount': '₹1,000', 'date': '', 'type': 'in'},
|
{'name': 'Manoj Singh', 'amount': '₹1,000', 'date': '', 'type': 'in'},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
List<String> accountNumbers = [
|
||||||
|
'0300015678903456',
|
||||||
|
'0300015678903678',
|
||||||
|
'0300015678903325',
|
||||||
|
];
|
||||||
|
|
||||||
|
String selectedAccount = '0300015678903456';
|
||||||
|
bool isVisible = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -34,8 +64,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: const Color(0xfff5f9fc),
|
backgroundColor: const Color(0xfff5f9fc),
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
title: const Text('kMobile', style: TextStyle(color: Colors.blueAccent,
|
title: Text(
|
||||||
fontWeight: FontWeight.w500),),
|
'kMobile',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
actions: [
|
actions: [
|
||||||
// IconButton(
|
// IconButton(
|
||||||
// icon: const Icon(Icons.notifications_outlined),
|
// icon: const Icon(Icons.notifications_outlined),
|
||||||
@ -48,11 +82,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
child: InkWell(
|
child: InkWell(
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(context, MaterialPageRoute(
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
builder: (context) => const Preference()));
|
builder: (context) => const Preference()));
|
||||||
},
|
},
|
||||||
child: const CircleAvatar(
|
child: const 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,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -66,45 +103,91 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
|
child: Text(
|
||||||
|
"Hi Trina Bakshi",
|
||||||
|
style: GoogleFonts.sriracha().copyWith(fontSize: 20),
|
||||||
|
),
|
||||||
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
// Account Info Card
|
// Account Info Card
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(24),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.blue[700],
|
color: Theme.of(context).primaryColor,
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
),
|
),
|
||||||
child: const Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text("Account Number: ", style:
|
const Text("Account Number: ",
|
||||||
|
style:
|
||||||
TextStyle(color: Colors.white, fontSize: 12)),
|
TextStyle(color: Colors.white, fontSize: 12)),
|
||||||
Text("03000156789462302", style:
|
DropdownButton<String>(
|
||||||
TextStyle(color: Colors.white, fontSize: 14)),
|
value: selectedAccount,
|
||||||
Padding(
|
dropdownColor: Theme.of(context).primaryColor,
|
||||||
padding: EdgeInsets.only(left: 5.0),
|
underline: const SizedBox(),
|
||||||
child: Icon(Symbols.keyboard_arrow_down, color: Colors.white),
|
icon: const Icon(Icons.keyboard_arrow_down),
|
||||||
|
iconEnabledColor: Colors.white,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white, fontSize: 14),
|
||||||
|
items: accountNumbers.map((String acc) {
|
||||||
|
return DropdownMenuItem<String>(
|
||||||
|
value: acc,
|
||||||
|
child: Text(acc,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white, fontSize: 14)),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
onChanged: (String? newValue) {
|
||||||
|
setState(() {
|
||||||
|
selectedAccount = newValue!;
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text("₹ *****", style: TextStyle(color: Colors.white,
|
const Text("₹ ",
|
||||||
fontSize: 24, fontWeight: FontWeight.w700)),
|
style: const TextStyle(
|
||||||
Icon(Symbols.visibility_lock, color: Colors.white),
|
color: Colors.white,
|
||||||
|
fontSize: 40,
|
||||||
|
fontWeight: FontWeight.w700)),
|
||||||
|
Text(isVisible ? "1,23,456" : "*****",
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 30,
|
||||||
|
fontWeight: FontWeight.w700)),
|
||||||
|
const Spacer(),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
isVisible = !isVisible;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Icon(
|
||||||
|
isVisible
|
||||||
|
? Symbols.visibility_lock
|
||||||
|
: Symbols.visibility,
|
||||||
|
color: Colors.white)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 18),
|
const SizedBox(height: 18),
|
||||||
const Text('Quick Links', style: TextStyle(fontSize: 15),),
|
const Text(
|
||||||
|
'Quick Links',
|
||||||
|
style: TextStyle(fontSize: 15),
|
||||||
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
// Quick Links
|
// Quick Links
|
||||||
@ -114,42 +197,56 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
children: [
|
children: [
|
||||||
_buildQuickLink(Symbols.id_card, "Customer \n Info", () {
|
_buildQuickLink(Symbols.id_card, "Customer \n Info", () {
|
||||||
Navigator.push(context, MaterialPageRoute(
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
builder: (context) => const CustomerInfoScreen()));
|
builder: (context) => const CustomerInfoScreen()));
|
||||||
}),
|
}),
|
||||||
_buildQuickLink(Symbols.currency_rupee, "Quick \n Pay",
|
_buildQuickLink(Symbols.currency_rupee, "Quick \n Pay", () {
|
||||||
() {
|
Navigator.push(
|
||||||
Navigator.push(context, MaterialPageRoute(
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
builder: (context) => const QuickPayScreen()));
|
builder: (context) => const QuickPayScreen()));
|
||||||
}),
|
}),
|
||||||
_buildQuickLink(Symbols.send_money, "Fund \n Transfer",
|
_buildQuickLink(Symbols.send_money, "Fund \n Transfer", () {
|
||||||
() {
|
Navigator.push(
|
||||||
Navigator.push(context, MaterialPageRoute(
|
context,
|
||||||
builder: (context) => const FundTransferBeneficiaryScreen()));
|
MaterialPageRoute(
|
||||||
|
builder: (context) =>
|
||||||
|
const FundTransferBeneficiaryScreen()));
|
||||||
}),
|
}),
|
||||||
_buildQuickLink(Symbols.server_person, "Account \n Info",
|
_buildQuickLink(Symbols.server_person, "Account \n Info", () {
|
||||||
(){
|
Navigator.push(
|
||||||
Navigator.push(context, MaterialPageRoute(
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
builder: (context) => const AccountInfoScreen()));
|
builder: (context) => const AccountInfoScreen()));
|
||||||
}),
|
}),
|
||||||
_buildQuickLink(Symbols.receipt_long, "Account \n History",
|
_buildQuickLink(Symbols.receipt_long, "Account \n History",
|
||||||
() {
|
() {
|
||||||
Navigator.push(context, MaterialPageRoute(
|
Navigator.push(
|
||||||
builder: (context) => const AccountStatementScreen()));
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) =>
|
||||||
|
const AccountStatementScreen()));
|
||||||
}),
|
}),
|
||||||
_buildQuickLink(Symbols.checkbook, "Handle \n Cheque",
|
_buildQuickLink(Symbols.checkbook, "Handle \n Cheque", () {
|
||||||
() {
|
Navigator.push(
|
||||||
Navigator.push(context, MaterialPageRoute(
|
context,
|
||||||
builder: (context) => const ChequeManagementScreen()));
|
MaterialPageRoute(
|
||||||
|
builder: (context) =>
|
||||||
|
const ChequeManagementScreen()));
|
||||||
}),
|
}),
|
||||||
_buildQuickLink(Icons.group, "Manage \n Beneficiary",
|
_buildQuickLink(Icons.group, "Manage \n Beneficiary", () {
|
||||||
() {
|
Navigator.push(
|
||||||
Navigator.push(context, MaterialPageRoute(
|
context,
|
||||||
builder: (context) => const ManageBeneficiariesScreen()));
|
MaterialPageRoute(
|
||||||
|
builder: (context) =>
|
||||||
|
const ManageBeneficiariesScreen()));
|
||||||
}),
|
}),
|
||||||
_buildQuickLink(Symbols.support_agent, "Contact \n Us",
|
_buildQuickLink(Symbols.support_agent, "Contact \n Us", () {
|
||||||
() {
|
Navigator.push(
|
||||||
Navigator.push(context, MaterialPageRoute(
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
builder: (context) => const EnquiryScreen()));
|
builder: (context) => const EnquiryScreen()));
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
@ -159,16 +256,20 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
// Recent Transactions
|
// Recent Transactions
|
||||||
const Align(
|
const Align(
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Text("Recent Transactions", style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
child: Text("Recent Transactions",
|
||||||
|
style:
|
||||||
|
TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||||
),
|
),
|
||||||
...transactions.map((tx) => ListTile(
|
...transactions.map((tx) => ListTile(
|
||||||
leading: Icon(tx['type'] == 'in' ? Symbols.call_received : Symbols.call_made, color: tx['type'] == 'in' ? Colors.green : Colors.red),
|
leading: Icon(
|
||||||
|
tx['type'] == 'in'
|
||||||
|
? Symbols.call_received
|
||||||
|
: Symbols.call_made,
|
||||||
|
color: tx['type'] == 'in' ? Colors.green : Colors.red),
|
||||||
title: Text(tx['name']!),
|
title: Text(tx['name']!),
|
||||||
subtitle: Text(tx['date']!),
|
subtitle: Text(tx['date']!),
|
||||||
trailing: Text(tx['amount']!),
|
trailing: Text(tx['amount']!),
|
||||||
)),
|
)),
|
||||||
|
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -182,9 +283,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Icon(icon, size: 30, color: Colors.blue[700]),
|
Icon(icon, size: 30, color: Theme.of(context).primaryColor),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text(label, textAlign: TextAlign.center, style: const TextStyle(fontSize: 12)),
|
Text(label,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: const TextStyle(fontSize: 12)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
16
pubspec.lock
16
pubspec.lock
@ -65,6 +65,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.19.1"
|
version: "1.19.1"
|
||||||
|
crypto:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: crypto
|
||||||
|
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.6"
|
||||||
cupertino_icons:
|
cupertino_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -245,6 +253,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.3"
|
version: "2.1.3"
|
||||||
|
google_fonts:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: google_fonts
|
||||||
|
sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.2.1"
|
||||||
http:
|
http:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -54,6 +54,7 @@ dependencies:
|
|||||||
path_provider: ^2.1.5
|
path_provider: ^2.1.5
|
||||||
flutter_swipe_button: ^2.1.3
|
flutter_swipe_button: ^2.1.3
|
||||||
provider: ^6.1.5
|
provider: ^6.1.5
|
||||||
|
google_fonts: ^6.2.1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -102,6 +103,12 @@ flutter:
|
|||||||
- asset: assets/fonts/Rubik-Regular.ttf
|
- asset: assets/fonts/Rubik-Regular.ttf
|
||||||
- asset: assets/fonts/Rubik-Bold.ttf
|
- asset: assets/fonts/Rubik-Bold.ttf
|
||||||
weight: 700
|
weight: 700
|
||||||
|
|
||||||
|
- family: Sriracha
|
||||||
|
fonts:
|
||||||
|
- asset: assets/fonts/Sriracha-Regular.ttf
|
||||||
|
|
||||||
|
|
||||||
# style: italic
|
# style: italic
|
||||||
# - family: Trajan Pro
|
# - family: Trajan Pro
|
||||||
# fonts:
|
# fonts:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user