Enquiry_screen ui changed

This commit is contained in:
2025-11-25 14:43:52 +05:30
parent 3358ec7669
commit b9147b30d5
4 changed files with 106 additions and 193 deletions

View File

@@ -74,9 +74,9 @@ Dio _createDioClient() {
final dio = Dio( final dio = Dio(
BaseOptions( BaseOptions(
baseUrl: baseUrl:
// 'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080', //test // 'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080', //test
//'http://lb-kccb-mobile-banking-app-848675342.ap-south-1.elb.amazonaws.com', //prod //'http://lb-kccb-mobile-banking-app-848675342.ap-south-1.elb.amazonaws.com', //prod
'https://kccbmbnk.net', //prod small 'https://kccbmbnk.net', //prod small
connectTimeout: const Duration(seconds: 60), connectTimeout: const Duration(seconds: 60),
receiveTimeout: const Duration(seconds: 60), receiveTimeout: const Duration(seconds: 60),
headers: { headers: {

View File

@@ -17,20 +17,16 @@ class AccountInfoScreen extends StatefulWidget {
} }
class _AccountInfoScreen extends State<AccountInfoScreen> { class _AccountInfoScreen extends State<AccountInfoScreen> {
late User selectedUser; late User selectedUser;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
selectedUser = widget.users[widget.selectedIndex]; selectedUser = widget.users[widget.selectedIndex];
} }
String getFullAccountType(String? accountType) { String getFullAccountType(String? accountType) {
if (accountType == null || accountType.isEmpty) return 'N/A'; if (accountType == null || accountType.isEmpty) return 'N/A';
// Convert to title case // Convert to title case
switch (accountType.toLowerCase()) { switch (accountType.toLowerCase()) {
@@ -51,245 +47,130 @@ class _AccountInfoScreen extends State<AccountInfoScreen> {
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final users = widget.users; final users = widget.users;
int selectedIndex = widget.selectedIndex; int selectedIndex = widget.selectedIndex;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text(AppLocalizations.of(context) title: Text(AppLocalizations.of(context)
.accountInfo .accountInfo
.replaceFirst(RegExp('\n'), '')), .replaceFirst(RegExp('\n'), '')),
), ),
body: Stack( body: Stack(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
children: [ children: [
Card( Card(
elevation: 4, elevation: 4,
margin: const EdgeInsets.symmetric(vertical: 8.0), margin: const EdgeInsets.symmetric(vertical: 8.0),
child: Padding( child: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
AppLocalizations.of(context).accountNumber, AppLocalizations.of(context).accountNumber,
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.bold, fontSize: 18), fontWeight: FontWeight.bold, fontSize: 18),
), ),
DropdownButton<User>( DropdownButton<User>(
value: selectedUser, value: selectedUser,
onChanged: (User? newUser) { onChanged: (User? newUser) {
if (newUser != null) { if (newUser != null) {
setState(() { setState(() {
selectedUser = newUser; selectedUser = newUser;
}); });
} }
}, },
items: widget.users.map((user) { items: widget.users.map((user) {
return DropdownMenuItem<User>( return DropdownMenuItem<User>(
value: user, value: user,
child: Text( child: Text(
user.accountNo.toString(), user.accountNo.toString(),
style: const TextStyle( style: const TextStyle(
fontSize: 20, fontWeight: FontWeight.bold), fontSize: 20, fontWeight: FontWeight.bold),
), ),
); );
}).toList(), }).toList(),
isExpanded: true, isExpanded: true,
), ),
], ],
), ),
), ),
), ),
Expanded( Expanded(
child: Card( child: Card(
elevation: 4, elevation: 4,
margin: const EdgeInsets.symmetric(vertical: 8.0), margin: const EdgeInsets.symmetric(vertical: 8.0),
child: Padding( child: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: ListView( child: ListView(
children: [ children: [
InfoRow( InfoRow(
title: AppLocalizations.of(context).customerNumber, title: AppLocalizations.of(context).customerNumber,
value: selectedUser.cifNumber ?? 'N/A', value: selectedUser.cifNumber ?? 'N/A',
), ),
InfoRow( InfoRow(
title: AppLocalizations.of(context).accountType, title: AppLocalizations.of(context).accountType,
value: getFullAccountType(selectedUser.accountType), value: getFullAccountType(selectedUser.accountType),
), ),
InfoRow( InfoRow(
title: AppLocalizations.of(context).productName, title: AppLocalizations.of(context).productName,
value: selectedUser.productType ?? 'N/A', value: selectedUser.productType ?? 'N/A',
), ),
InfoRow( InfoRow(
title: AppLocalizations.of(context).accountStatus, title: AppLocalizations.of(context).accountStatus,
value: 'OPEN', value: 'OPEN',
), ),
InfoRow( InfoRow(
title: title:
AppLocalizations.of(context).availableBalance, AppLocalizations.of(context).availableBalance,
value: selectedUser.availableBalance ?? 'N/A', value: selectedUser.availableBalance ?? 'N/A',
), ),
InfoRow( InfoRow(
title: AppLocalizations.of(context).currentBalance, title: AppLocalizations.of(context).currentBalance,
value: selectedUser.currentBalance ?? 'N/A', value: selectedUser.currentBalance ?? 'N/A',
), ),
if (users[selectedIndex].approvedAmount != null) if (users[selectedIndex].approvedAmount != null)
InfoRow( InfoRow(
title: title:
AppLocalizations.of(context).approvedAmount, AppLocalizations.of(context).approvedAmount,
value: selectedUser.approvedAmount ?? 'N/A', value: selectedUser.approvedAmount ?? 'N/A',
), ),
], ],
), ),
), ),
), ),
), ),
], ],
), ),
), ),
IgnorePointer( IgnorePointer(
child: Center( child: Center(
child: Opacity( child: Opacity(
opacity: 0.07, // Reduced opacity opacity: 0.07, // Reduced opacity
child: ClipOval( child: ClipOval(
child: Image.asset( child: Image.asset(
'assets/images/logo.png', 'assets/images/logo.png',
width: 200, // Adjust size as needed width: 200, // Adjust size as needed
height: 200, // Adjust size as needed height: 200, // Adjust size as needed
), ),
), ),
), ),
), ),
), ),
], ],
), ),
); );
} }
} }
class InfoRow extends StatelessWidget { class InfoRow extends StatelessWidget {

View File

@@ -55,7 +55,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
try { try {
final repo = getIt<TransactionRepository>(); final repo = getIt<TransactionRepository>();
final txs = await repo.fetchTransactions( final txs = await repo.fetchTransactions(
selectedUser.accountNo?? '', selectedUser.accountNo ?? '',
fromDate: fromDate, fromDate: fromDate,
toDate: toDate, toDate: toDate,
); );

View File

@@ -53,27 +53,54 @@ class _EnquiryScreen extends State<EnquiryScreen> {
} }
Widget _buildContactItem(String role, String email, String phone) { Widget _buildContactItem(String role, String email, String phone) {
return Column( return Card(
crossAxisAlignment: CrossAxisAlignment.start, elevation: 4,
children: [ margin: const EdgeInsets.symmetric(vertical: 8),
Text(role, child: Padding(
style: TextStyle(color: Theme.of(context).colorScheme.onSurface)), padding: const EdgeInsets.all(16.0),
const SizedBox(height: 4), child: Column(
GestureDetector( crossAxisAlignment: CrossAxisAlignment.start,
onTap: () => _launchEmailAddress(email), children: [
child: Text(email, Text(role,
style: TextStyle(color: Theme.of(context).colorScheme.primary)), style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontSize: 15,
fontWeight: FontWeight.bold)),
const SizedBox(height: 8),
GestureDetector(
onTap: () => _launchEmailAddress(email),
child: Row(
children: [
const Icon(Icons.email),
const SizedBox(width: 8),
Expanded(
child: Text(email,
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
fontSize: 14)),
),
],
),
),
const SizedBox(height: 8),
GestureDetector(
onTap: () => _launchPhoneNumber(phone),
child: Row(
children: [
const Icon(Icons.phone),
const SizedBox(width: 8),
Expanded(
child: Text(phone,
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
fontSize: 14)),
),
],
),
),
],
), ),
const SizedBox(height: 4), ),
GestureDetector(
onTap: () => _launchPhoneNumber(phone),
child: Text(phone,
style: TextStyle(
color: Theme.of(context)
.colorScheme
.primary)), // Changed color for visibility
),
],
); );
} }
@@ -91,62 +118,67 @@ class _EnquiryScreen extends State<EnquiryScreen> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const SizedBox(height: 20), Card(
GestureDetector( elevation: 4,
child: InkWell(
onTap: () => onTap: () =>
_launchUrl("https://kccbhp.bank.in/complaint-form/"), _launchUrl("https://kccbhp.bank.in/complaint-form/"),
child: Row(mainAxisSize: MainAxisSize.min, children: [ child: Padding(
Text( padding: const EdgeInsets.all(16.0),
"Complaint Form", child: Row(
style: TextStyle( mainAxisAlignment: MainAxisAlignment.spaceBetween,
fontSize: 17, children: [
color: Theme.of(context).colorScheme.primary, Text(
decoration: TextDecoration "Complaint Form",
.underline, // Added underline for link clarity style: TextStyle(
decorationColor: fontSize: 15,
Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
), ),
),
Icon(
Icons.open_in_new,
color: Theme.of(context).colorScheme.primary,
size: 16.0,
),
],
), ),
const SizedBox(width: 4), ),
Icon( ),
Icons.open_in_new, ),
color: Theme.of(context).colorScheme.primary, const Divider(height: 32),
size: 16.0,
),
])),
const SizedBox(height: 40),
Text( Text(
AppLocalizations.of(context).keyContacts, AppLocalizations.of(context).keyContacts,
style: TextStyle( style: const TextStyle(
fontSize: 17, fontSize: 15,
color: Theme.of(context).colorScheme.primary, fontWeight: FontWeight.bold,
), ),
// horizontal line
),
Divider(color: Theme.of(context).colorScheme.outline),
const SizedBox(height: 16),
_buildContactItem(
AppLocalizations.of(context).chairman,
"chairman@kccb.in",
"01892-222677",
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
_buildContactItem( Expanded(
AppLocalizations.of(context).managingDirector, child: ListView(
"md@kccb.in", children: [
"01892-224969", _buildContactItem(
), AppLocalizations.of(context).chairman,
const SizedBox(height: 16), "chairman@kccb.in",
_buildContactItem( "01892-222677",
AppLocalizations.of(context).gmWest, ),
"gmw@kccb.in", _buildContactItem(
"01892-223280", AppLocalizations.of(context).managingDirector,
), "md@kccb.in",
const SizedBox(height: 16), "01892-224969",
_buildContactItem( ),
AppLocalizations.of(context).gmNorth, _buildContactItem(
"gmn@kccb.in", AppLocalizations.of(context).gmWest,
"01892-224607", "gmw@kccb.in",
"01892-223280",
),
_buildContactItem(
AppLocalizations.of(context).gmNorth,
"gmn@kccb.in",
"01892-224607",
),
],
),
), ),
], ],
), ),