Account Statement UI Changed
This commit is contained in:
@@ -146,42 +146,59 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Card(
|
||||||
AppLocalizations.of(context).accountNumber,
|
margin: const EdgeInsets.only(bottom: 10),
|
||||||
style: const TextStyle(
|
child: Padding(
|
||||||
fontWeight: FontWeight.w500, fontSize: 14),
|
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>(
|
Card(
|
||||||
value: selectedUser,
|
margin: const EdgeInsets.only(bottom: 10),
|
||||||
onChanged: (User? newUser) {
|
child: Padding(
|
||||||
if (newUser != null) {
|
padding: const EdgeInsets.all(16.0),
|
||||||
setState(() {
|
child: Row(
|
||||||
selectedUser = newUser;
|
children: [
|
||||||
});
|
Text(
|
||||||
_loadTransactions();
|
"${AppLocalizations.of(context).availableBalance}: ",
|
||||||
}
|
style: const TextStyle(
|
||||||
},
|
fontSize: 17,
|
||||||
items: widget.users.map((user) {
|
),
|
||||||
return DropdownMenuItem<User>(
|
),
|
||||||
value: user,
|
Text(' ₹ ${selectedUser.availableBalance}',
|
||||||
child: Text(user.accountNo.toString()),
|
style: const TextStyle(fontSize: 17)),
|
||||||
);
|
],
|
||||||
}).toList(),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 15),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${AppLocalizations.of(context).availableBalance}: ",
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 17,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Text(' ₹ ${selectedUser.availableBalance}',
|
),
|
||||||
style: const TextStyle(fontSize: 17)),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
|
||||||
Text(
|
Text(
|
||||||
AppLocalizations.of(context).filters,
|
AppLocalizations.of(context).filters,
|
||||||
style: const TextStyle(fontSize: 17),
|
style: const TextStyle(fontSize: 17),
|
||||||
@@ -300,63 +317,65 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
|||||||
Theme.of(context).colorScheme.onSurface,
|
Theme.of(context).colorScheme.onSurface,
|
||||||
)),
|
)),
|
||||||
)
|
)
|
||||||
: ListView.separated(
|
: ListView.builder(
|
||||||
itemCount: _transactions.length,
|
itemCount: _transactions.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final tx = _transactions[index];
|
final tx = _transactions[index];
|
||||||
return ListTile(
|
return Card(
|
||||||
leading: Icon(
|
margin: const EdgeInsets.symmetric(
|
||||||
tx.type == 'CR'
|
horizontal: 0, vertical: 4),
|
||||||
? Symbols.call_received
|
child: ListTile(
|
||||||
: Symbols.call_made,
|
leading: Icon(
|
||||||
color: tx.type == 'CR'
|
tx.type == 'CR'
|
||||||
? const Color(0xFF10BB10)
|
? Symbols.call_received
|
||||||
: Theme.of(context).colorScheme.error,
|
: 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);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -666,7 +666,7 @@ class _DashboardScreenState extends State<DashboardScreen>
|
|||||||
const EnquiryScreen()));
|
const EnquiryScreen()));
|
||||||
}),
|
}),
|
||||||
_buildQuickLink(
|
_buildQuickLink(
|
||||||
Symbols.request_quote,
|
Symbols.checkbook,
|
||||||
AppLocalizations.of(context).chequeManagement,
|
AppLocalizations.of(context).chequeManagement,
|
||||||
() {
|
() {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
|
|||||||
Reference in New Issue
Block a user