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