Account Info card changes and snackbar in statement

This commit is contained in:
2025-12-04 15:40:24 +05:30
parent fbf6df7181
commit 6796793aac
7 changed files with 84 additions and 84 deletions

View File

@@ -614,6 +614,14 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
),
payload: filePath,
);
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('PDF saved to: $filePath'),
),
);
}
} catch (e) {
await flutterLocalNotificationsPlugin.show(
0,
@@ -629,6 +637,14 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
icon: 'notification_icon'),
),
);
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Error saving PDF: $e'),
),
);
}
}
}

View File

@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import 'package:kmobile/data/models/user.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import '../../../l10n/app_localizations.dart';
class AllAccountsScreen extends StatefulWidget {
final List<User> users;
const AllAccountsScreen({super.key, required this.users});
@@ -18,20 +20,24 @@ class _AllAccountsScreenState extends State<AllAccountsScreen> {
// In a real app, this should be moved to a utility/helper class.
if (accountType == null || accountType.isEmpty) return 'N/A';
switch (accountType.toLowerCase()) {
case 'sa':
return "Savings Account"; // Using hardcoded strings for simplicity
case 'sa':
return AppLocalizations.of(context).savingsAccount;
case 'sb':
return "Savings Account";
return AppLocalizations.of(context).savingsAccount;
case 'ln':
return "Loan Account";
return AppLocalizations.of(context).loanAccount;
case 'td':
return "Term Deposit";
return AppLocalizations.of(context).termDeposit;
case 'rd':
return "Recurring Deposit";
return AppLocalizations.of(context).recurringDeposit;
case 'ca':
return "Current Account";
default:
return "Unknown Account";
case 'cc':
return "Cash Credit Account";
case 'od':
return "Overdraft Account";
default:
return AppLocalizations.of(context).unknownAccount;
}
}
@@ -39,9 +45,13 @@ class _AllAccountsScreenState extends State<AllAccountsScreen> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('All Accounts'),
title: Text(AppLocalizations.of(context).viewall),
),
body: ListView.builder(
body: Column(
children: [
const SizedBox(height: 16.0), // Added space below the app bar
Expanded(
child: ListView.builder(
itemCount: widget.users.length,
itemBuilder: (context, index) {
final user = widget.users[index];
@@ -52,6 +62,9 @@ class _AllAccountsScreenState extends State<AllAccountsScreen> {
);
},
),
), // Closing Expanded
], // Closing Column
),
);
}

View File

@@ -65,48 +65,7 @@ class _DashboardScreenState extends State<DashboardScreen>
});
}
Widget _buildViewAllTab(List<User> users) {
return GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AllAccountsScreen(users: users),
),
);
},
child: Container(
width: 40, // Small width for the tab
height: 160,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceVariant,
),
child: const Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"View",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 12,
),
),
Text(
"All",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 12,
),
),
Icon(
Icons.arrow_forward_ios,
size: 16,
),
],
),
),
);
}
Widget _buildAccountCard(User user, bool isSelected) {
final theme = Theme.of(context);
@@ -116,10 +75,7 @@ class _DashboardScreenState extends State<DashboardScreen>
return AnimatedScale(
duration: const Duration(milliseconds: 200),
scale: scale,
child: Transform.translate(
offset: isSelected ? const Offset(10.0, 0.0) : Offset.zero,
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 2),
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 18,
vertical: 10,
@@ -256,8 +212,7 @@ class _DashboardScreenState extends State<DashboardScreen>
],
),
),
),
);
);
}
Future<void> _refreshAccountData(BuildContext context) async {
@@ -501,7 +456,7 @@ class _DashboardScreenState extends State<DashboardScreen>
}
_pageController ??= PageController(
initialPage: selectedAccountIndex,
viewportFraction: 0.80,
viewportFraction: 1.0,
);
final firstName = getProcessedFirstName(currAccount.name);
@@ -533,18 +488,13 @@ class _DashboardScreenState extends State<DashboardScreen>
child: Stack(
children: [
// PageView part, painted underneath
Padding(
padding: const EdgeInsets.only(
left: 48.0), // Space for tab (40) + gap (8)
child: SizedBox(
SizedBox(
// Keep SizedBox for PageView height
height: 160,
child: PageView.builder(
controller: _pageController,
itemCount: users.length,
clipBehavior: Clip
.none, // Keep this to show adjacent cards
padEnds: false,
itemCount: users.length, // Keep this to show adjacent cards
onPageChanged: (int newIndex) async {
if (newIndex == selectedAccountIndex)
return;
@@ -569,16 +519,36 @@ class _DashboardScreenState extends State<DashboardScreen>
},
),
),
),
// View All tab part, painted on top
Align(
alignment: Alignment.centerLeft,
child: _buildViewAllTab(users),
),
],
),
),
),
const SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AllAccountsScreen(users: users),
),
);
},
child: Text(
AppLocalizations.of(context).viewall,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: theme.colorScheme.primary,
),
),
),
],
),
const SizedBox(height: 18),
Text(
AppLocalizations.of(context).quickLinks,

View File

@@ -37,8 +37,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
Future<String> _getAppVersion() async {
final PackageInfo info = await PackageInfo.fromPlatform();
return 'Version ${info.version} (${info.buildNumber})';
return 'Version 1.0.1 (1))';
}
Future<void> _loadBiometricStatus() async {

View File

@@ -413,5 +413,6 @@
"ftownsubtitle": "Send money to your saved beneficiaries within Kangra Bank",
"ftoutsidesubtitle": "Transfer funds to your saved beneficiaries in any other bank across India",
"personaldetails": "Personal Details",
"kycdetails": "KYC Details"
"kycdetails": "KYC Details",
"viewall": "View All"
}

View File

@@ -414,5 +414,6 @@
"ftownsubtitle": "कांगड़ा बैंक के माध्यम से अपने बचत लाभार्थियों को पैसे भेजें",
"ftoutsidesubtitle": "भारत भर में किसी भी अन्य बैंक में अपने सहेजे गए लाभार्थियों को धनराशि हस्तांतरित करें",
"personaldetails": "व्यक्तिगत विवरण",
"kycdetails": "केवाईसी विवरण"
"kycdetails": "केवाईसी विवरण",
"viewall": "सभी देखें"
}

View File

@@ -15,13 +15,13 @@ void main() async {
]);
// Check for device compromise
// final compromisedMessage = await SecurityService.deviceCompromisedMessage;
// if (compromisedMessage != null) {
// runApp(MaterialApp(
// home: SecurityErrorScreen(message: compromisedMessage),
// ));
// return;
// }
final compromisedMessage = await SecurityService.deviceCompromisedMessage;
if (compromisedMessage != null) {
runApp(MaterialApp(
home: SecurityErrorScreen(message: compromisedMessage),
));
return;
}
await setupDependencies();
runApp(const KMobile());
}