Account Statement UI Changed

This commit is contained in:
2025-11-28 12:22:51 +05:30
parent 04a1ce26ec
commit 8aa5b170ca
2 changed files with 104 additions and 85 deletions

View File

@@ -146,42 +146,59 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
AppLocalizations.of(context).accountNumber,
style: const TextStyle(
fontWeight: FontWeight.w500, fontSize: 14),
Card(
margin: const EdgeInsets.only(bottom: 10),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
AppLocalizations.of(context).accountNumber,
style: const TextStyle(
fontWeight: FontWeight.w500, fontSize: 17),
),
const VerticalDivider(width: 20, thickness: 1, indent: 5, endIndent: 5, color: Colors.grey),
DropdownButton<User>(
value: selectedUser,
onChanged: (User? newUser) {
if (newUser != null) {
setState(() {
selectedUser = newUser;
});
_loadTransactions();
}
},
items: widget.users.map((user) {
return DropdownMenuItem<User>(
value: user,
child: Text(user.accountNo.toString()),
);
}).toList(),
underline: Container(), // Remove the underline
),
Spacer(),
],
), ),
),
DropdownButton<User>(
value: selectedUser,
onChanged: (User? newUser) {
if (newUser != null) {
setState(() {
selectedUser = newUser;
});
_loadTransactions();
}
},
items: widget.users.map((user) {
return DropdownMenuItem<User>(
value: user,
child: Text(user.accountNo.toString()),
);
}).toList(),
),
const SizedBox(height: 15),
Row(
children: [
Text(
"${AppLocalizations.of(context).availableBalance}: ",
style: const TextStyle(
fontSize: 17,
),
Card(
margin: const EdgeInsets.only(bottom: 10),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: [
Text(
"${AppLocalizations.of(context).availableBalance}: ",
style: const TextStyle(
fontSize: 17,
),
),
Text('${selectedUser.availableBalance}',
style: const TextStyle(fontSize: 17)),
],
),
Text('${selectedUser.availableBalance}',
style: const TextStyle(fontSize: 17)),
],
),
),
const SizedBox(height: 15),
Text(
AppLocalizations.of(context).filters,
style: const TextStyle(fontSize: 17),
@@ -300,63 +317,65 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
Theme.of(context).colorScheme.onSurface,
)),
)
: ListView.separated(
: ListView.builder(
itemCount: _transactions.length,
itemBuilder: (context, index) {
final tx = _transactions[index];
return ListTile(
leading: Icon(
tx.type == 'CR'
? Symbols.call_received
: Symbols.call_made,
color: tx.type == 'CR'
? const Color(0xFF10BB10)
: Theme.of(context).colorScheme.error,
return Card(
margin: const EdgeInsets.symmetric(
horizontal: 0, vertical: 4),
child: ListTile(
leading: Icon(
tx.type == 'CR'
? Symbols.call_received
: Symbols.call_made,
color: tx.type == 'CR'
? const Color(0xFF10BB10)
: Theme.of(context).colorScheme.error,
),
title: Text(
tx.date ?? '',
style: const TextStyle(fontSize: 15),
),
subtitle: Text(
tx.name != null
? (tx.name!.length > 22
? tx.name!.substring(0, 22)
: tx.name!)
: '',
style: const TextStyle(fontSize: 12),
),
trailing: Column(
crossAxisAlignment:
CrossAxisAlignment.end,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
"${tx.amount}",
style: const TextStyle(fontSize: 17),
),
Text(
"Bal: ₹${tx.balance}",
style: const TextStyle(
fontSize:
12), // Style matches tx.name
),
],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) =>
TransactionDetailsScreen(
transaction: tx),
),
);
},
),
title: Text(
tx.date ?? '',
style: const TextStyle(fontSize: 15),
),
subtitle: Text(
tx.name != null
? (tx.name!.length > 22
? tx.name!.substring(0, 22)
: tx.name!)
: '',
style: const TextStyle(fontSize: 12),
),
trailing: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"${tx.amount}",
style: const TextStyle(fontSize: 17),
),
Text(
"Bal: ₹${tx.balance}",
style: const TextStyle(
fontSize:
12), // Style matches tx.name
),
],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) =>
TransactionDetailsScreen(
transaction: tx),
),
);
},
);
},
separatorBuilder: (context, index) {
return Divider(
color: Theme.of(context).dividerColor);
},
),
),
],

View File

@@ -666,7 +666,7 @@ class _DashboardScreenState extends State<DashboardScreen>
const EnquiryScreen()));
}),
_buildQuickLink(
Symbols.request_quote,
Symbols.checkbook,
AppLocalizations.of(context).chequeManagement,
() {
Navigator.push(