dashboard#1
This commit is contained in:
@@ -97,8 +97,8 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
||||
return;
|
||||
}
|
||||
final now = DateTime.now();
|
||||
final maxToDate = fromDate!.add(const Duration(days: 31)).isBefore(now)
|
||||
? fromDate!.add(const Duration(days: 31))
|
||||
final maxToDate = fromDate!.add(const Duration(days: 183)).isBefore(now)
|
||||
? fromDate!.add(const Duration(days: 183))
|
||||
: now;
|
||||
final picked = await showDatePicker(
|
||||
context: context,
|
||||
|
||||
@@ -474,9 +474,12 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
|
||||
// Quick Links
|
||||
GridView.count(
|
||||
crossAxisCount: 4,
|
||||
crossAxisCount: 2, // Changed to 2 for two cards in a row
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
crossAxisSpacing: 10,
|
||||
mainAxisSpacing: 10,
|
||||
childAspectRatio: 1.2, // Adjusted for better fit with 2 cards
|
||||
children: [
|
||||
_buildQuickLink(
|
||||
Symbols.id_card,
|
||||
@@ -582,66 +585,6 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
|
||||
// Recent Transactions
|
||||
Text(
|
||||
AppLocalizations.of(context).recentTransactions,
|
||||
style: const TextStyle(fontSize: 17),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
if (_txLoading)
|
||||
..._buildTransactionShimmer()
|
||||
else if (_transactions.isNotEmpty)
|
||||
..._transactions.map(
|
||||
(tx) => ListTile(
|
||||
leading: Icon(
|
||||
tx.type == 'CR'
|
||||
? Symbols.call_received
|
||||
: Symbols.call_made,
|
||||
color: tx.type == 'CR'
|
||||
? const Color(0xFF10BB10)
|
||||
: theme.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: Text(
|
||||
"₹${tx.amount}",
|
||||
style: const TextStyle(fontSize: 17),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) =>
|
||||
TransactionDetailsScreen(transaction: tx),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
else
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 24.0),
|
||||
child: Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context).noTransactions,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -689,28 +632,39 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
bool disable = false,
|
||||
}) {
|
||||
final theme = Theme.of(context);
|
||||
return InkWell(
|
||||
return Card(
|
||||
elevation: 4,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: disable ? null : onTap,
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
icon,
|
||||
size: 30,
|
||||
size: 40,
|
||||
color: disable
|
||||
? theme.colorScheme.onSurface.withOpacity(0.3)
|
||||
? theme.disabledColor
|
||||
: theme.colorScheme.primary,
|
||||
grade: 200,
|
||||
weight: 700,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
label,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 13),
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: disable
|
||||
? theme.disabledColor
|
||||
: theme.colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,23 +27,13 @@ class _ServiceScreen extends State<ServiceScreen> {
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
ListView(
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// ServiceManagementTile(
|
||||
// icon: Symbols.add,
|
||||
// label: AppLocalizations.of(context).accountOpeningDeposit,
|
||||
// onTap: () {},
|
||||
// disabled: true,
|
||||
// ),
|
||||
// const Divider(height: 1),
|
||||
// ServiceManagementTile(
|
||||
// icon: Symbols.add,
|
||||
// label: AppLocalizations.of(context).accountOpeningLoan,
|
||||
// onTap: () {},
|
||||
// disabled: true,
|
||||
// ),
|
||||
// const Divider(height: 1),
|
||||
ServiceManagementTile(
|
||||
Expanded(
|
||||
child: ServiceManagementTile(
|
||||
icon: Symbols.captive_portal,
|
||||
label: AppLocalizations.of(context).quickLinks,
|
||||
onTap: () {
|
||||
@@ -54,8 +44,10 @@ class _ServiceScreen extends State<ServiceScreen> {
|
||||
},
|
||||
disabled: false,
|
||||
),
|
||||
Divider(height: 1, color: Theme.of(context).dividerColor),
|
||||
ServiceManagementTile(
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Expanded(
|
||||
child: ServiceManagementTile(
|
||||
icon: Symbols.question_mark,
|
||||
label: AppLocalizations.of(context).faq,
|
||||
onTap: () {
|
||||
@@ -65,8 +57,10 @@ class _ServiceScreen extends State<ServiceScreen> {
|
||||
},
|
||||
disabled: false,
|
||||
),
|
||||
Divider(height: 1, color: Theme.of(context).dividerColor),
|
||||
ServiceManagementTile(
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Expanded(
|
||||
child: ServiceManagementTile(
|
||||
icon: Symbols.location_pin,
|
||||
label: "ATM Locator",
|
||||
onTap: () {
|
||||
@@ -77,9 +71,11 @@ Divider(height: 1, color: Theme.of(context).dividerColor),
|
||||
},
|
||||
disabled: false,
|
||||
),
|
||||
Divider(height: 1, color: Theme.of(context).dividerColor),
|
||||
),
|
||||
// No Spacer() needed here as Expanded children will fill space
|
||||
],
|
||||
),
|
||||
),
|
||||
IgnorePointer(
|
||||
child: Center(
|
||||
child: Opacity(
|
||||
@@ -117,23 +113,38 @@ class ServiceManagementTile extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return ListTile(
|
||||
leading: Icon(
|
||||
return Card(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
elevation: 4, // Add some elevation for better visual separation
|
||||
child: InkWell(
|
||||
onTap: disabled ? null : onTap, // Disable InkWell if the tile is disabled
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 24.0, horizontal: 16.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
icon,
|
||||
color: disabled ? theme.disabledColor : null,
|
||||
size: 48, // Make icon larger
|
||||
color: disabled ? theme.disabledColor : theme.colorScheme.primary,
|
||||
),
|
||||
title: Text(
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
color: disabled ? theme.disabledColor : null,
|
||||
textAlign: TextAlign.center,
|
||||
style: theme.textTheme.titleLarge?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: disabled ? theme.disabledColor : theme.colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
trailing: Icon(
|
||||
Symbols.arrow_right,
|
||||
size: 20,
|
||||
color: disabled ? theme.disabledColor : null,
|
||||
),
|
||||
onTap: disabled ? null : onTap,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user