Account Info card changes and snackbar in statement
This commit is contained in:
@@ -614,6 +614,14 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
|||||||
),
|
),
|
||||||
payload: filePath,
|
payload: filePath,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (mounted) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text('PDF saved to: $filePath'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await flutterLocalNotificationsPlugin.show(
|
await flutterLocalNotificationsPlugin.show(
|
||||||
0,
|
0,
|
||||||
@@ -629,6 +637,14 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
|
|||||||
icon: 'notification_icon'),
|
icon: 'notification_icon'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (mounted) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text('Error saving PDF: $e'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:kmobile/data/models/user.dart';
|
import 'package:kmobile/data/models/user.dart';
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
|
|
||||||
|
import '../../../l10n/app_localizations.dart';
|
||||||
|
|
||||||
class AllAccountsScreen extends StatefulWidget {
|
class AllAccountsScreen extends StatefulWidget {
|
||||||
final List<User> users;
|
final List<User> users;
|
||||||
const AllAccountsScreen({super.key, required this.users});
|
const AllAccountsScreen({super.key, required this.users});
|
||||||
@@ -19,19 +21,23 @@ class _AllAccountsScreenState extends State<AllAccountsScreen> {
|
|||||||
if (accountType == null || accountType.isEmpty) return 'N/A';
|
if (accountType == null || accountType.isEmpty) return 'N/A';
|
||||||
switch (accountType.toLowerCase()) {
|
switch (accountType.toLowerCase()) {
|
||||||
case 'sa':
|
case 'sa':
|
||||||
return "Savings Account"; // Using hardcoded strings for simplicity
|
return AppLocalizations.of(context).savingsAccount;
|
||||||
case 'sb':
|
case 'sb':
|
||||||
return "Savings Account";
|
return AppLocalizations.of(context).savingsAccount;
|
||||||
case 'ln':
|
case 'ln':
|
||||||
return "Loan Account";
|
return AppLocalizations.of(context).loanAccount;
|
||||||
case 'td':
|
case 'td':
|
||||||
return "Term Deposit";
|
return AppLocalizations.of(context).termDeposit;
|
||||||
case 'rd':
|
case 'rd':
|
||||||
return "Recurring Deposit";
|
return AppLocalizations.of(context).recurringDeposit;
|
||||||
case 'ca':
|
case 'ca':
|
||||||
return "Current Account";
|
return "Current Account";
|
||||||
|
case 'cc':
|
||||||
|
return "Cash Credit Account";
|
||||||
|
case 'od':
|
||||||
|
return "Overdraft Account";
|
||||||
default:
|
default:
|
||||||
return "Unknown Account";
|
return AppLocalizations.of(context).unknownAccount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,9 +45,13 @@ class _AllAccountsScreenState extends State<AllAccountsScreen> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
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,
|
itemCount: widget.users.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final user = widget.users[index];
|
final user = widget.users[index];
|
||||||
@@ -51,6 +61,9 @@ class _AllAccountsScreenState extends State<AllAccountsScreen> {
|
|||||||
child: _buildAccountCard(user),
|
child: _buildAccountCard(user),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
),
|
||||||
|
), // Closing Expanded
|
||||||
|
], // Closing Column
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
Widget _buildAccountCard(User user, bool isSelected) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
@@ -116,10 +75,7 @@ class _DashboardScreenState extends State<DashboardScreen>
|
|||||||
return AnimatedScale(
|
return AnimatedScale(
|
||||||
duration: const Duration(milliseconds: 200),
|
duration: const Duration(milliseconds: 200),
|
||||||
scale: scale,
|
scale: scale,
|
||||||
child: Transform.translate(
|
|
||||||
offset: isSelected ? const Offset(10.0, 0.0) : Offset.zero,
|
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 2),
|
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 18,
|
horizontal: 18,
|
||||||
vertical: 10,
|
vertical: 10,
|
||||||
@@ -256,7 +212,6 @@ class _DashboardScreenState extends State<DashboardScreen>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,7 +456,7 @@ class _DashboardScreenState extends State<DashboardScreen>
|
|||||||
}
|
}
|
||||||
_pageController ??= PageController(
|
_pageController ??= PageController(
|
||||||
initialPage: selectedAccountIndex,
|
initialPage: selectedAccountIndex,
|
||||||
viewportFraction: 0.80,
|
viewportFraction: 1.0,
|
||||||
);
|
);
|
||||||
final firstName = getProcessedFirstName(currAccount.name);
|
final firstName = getProcessedFirstName(currAccount.name);
|
||||||
|
|
||||||
@@ -533,18 +488,13 @@ class _DashboardScreenState extends State<DashboardScreen>
|
|||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
// PageView part, painted underneath
|
// PageView part, painted underneath
|
||||||
Padding(
|
SizedBox(
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
left: 48.0), // Space for tab (40) + gap (8)
|
|
||||||
child: SizedBox(
|
|
||||||
// Keep SizedBox for PageView height
|
// Keep SizedBox for PageView height
|
||||||
height: 160,
|
height: 160,
|
||||||
child: PageView.builder(
|
child: PageView.builder(
|
||||||
controller: _pageController,
|
controller: _pageController,
|
||||||
itemCount: users.length,
|
itemCount: users.length, // Keep this to show adjacent cards
|
||||||
clipBehavior: Clip
|
|
||||||
.none, // Keep this to show adjacent cards
|
|
||||||
padEnds: false,
|
|
||||||
onPageChanged: (int newIndex) async {
|
onPageChanged: (int newIndex) async {
|
||||||
if (newIndex == selectedAccountIndex)
|
if (newIndex == selectedAccountIndex)
|
||||||
return;
|
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),
|
const SizedBox(height: 18),
|
||||||
Text(
|
Text(
|
||||||
AppLocalizations.of(context).quickLinks,
|
AppLocalizations.of(context).quickLinks,
|
||||||
|
|||||||
@@ -37,8 +37,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<String> _getAppVersion() async {
|
Future<String> _getAppVersion() async {
|
||||||
final PackageInfo info = await PackageInfo.fromPlatform();
|
return 'Version 1.0.1 (1))';
|
||||||
return 'Version ${info.version} (${info.buildNumber})';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _loadBiometricStatus() async {
|
Future<void> _loadBiometricStatus() async {
|
||||||
|
|||||||
@@ -413,5 +413,6 @@
|
|||||||
"ftownsubtitle": "Send money to your saved beneficiaries within Kangra Bank",
|
"ftownsubtitle": "Send money to your saved beneficiaries within Kangra Bank",
|
||||||
"ftoutsidesubtitle": "Transfer funds to your saved beneficiaries in any other bank across India",
|
"ftoutsidesubtitle": "Transfer funds to your saved beneficiaries in any other bank across India",
|
||||||
"personaldetails": "Personal Details",
|
"personaldetails": "Personal Details",
|
||||||
"kycdetails": "KYC Details"
|
"kycdetails": "KYC Details",
|
||||||
|
"viewall": "View All"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -414,5 +414,6 @@
|
|||||||
"ftownsubtitle": "कांगड़ा बैंक के माध्यम से अपने बचत लाभार्थियों को पैसे भेजें",
|
"ftownsubtitle": "कांगड़ा बैंक के माध्यम से अपने बचत लाभार्थियों को पैसे भेजें",
|
||||||
"ftoutsidesubtitle": "भारत भर में किसी भी अन्य बैंक में अपने सहेजे गए लाभार्थियों को धनराशि हस्तांतरित करें",
|
"ftoutsidesubtitle": "भारत भर में किसी भी अन्य बैंक में अपने सहेजे गए लाभार्थियों को धनराशि हस्तांतरित करें",
|
||||||
"personaldetails": "व्यक्तिगत विवरण",
|
"personaldetails": "व्यक्तिगत विवरण",
|
||||||
"kycdetails": "केवाईसी विवरण"
|
"kycdetails": "केवाईसी विवरण",
|
||||||
|
"viewall": "सभी देखें"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ void main() async {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
// Check for device compromise
|
// Check for device compromise
|
||||||
// final compromisedMessage = await SecurityService.deviceCompromisedMessage;
|
final compromisedMessage = await SecurityService.deviceCompromisedMessage;
|
||||||
// if (compromisedMessage != null) {
|
if (compromisedMessage != null) {
|
||||||
// runApp(MaterialApp(
|
runApp(MaterialApp(
|
||||||
// home: SecurityErrorScreen(message: compromisedMessage),
|
home: SecurityErrorScreen(message: compromisedMessage),
|
||||||
// ));
|
));
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
await setupDependencies();
|
await setupDependencies();
|
||||||
runApp(const KMobile());
|
runApp(const KMobile());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user