Code Formatting
This commit is contained in:
@@ -84,4 +84,4 @@ class LimitService {
|
||||
}
|
||||
return response.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,7 @@ 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':
|
||||
case 'sa':
|
||||
return AppLocalizations.of(context).savingsAccount;
|
||||
case 'sb':
|
||||
return AppLocalizations.of(context).savingsAccount;
|
||||
@@ -36,7 +36,7 @@ class _AllAccountsScreenState extends State<AllAccountsScreen> {
|
||||
return "Cash Credit Account";
|
||||
case 'od':
|
||||
return "Overdraft Account";
|
||||
default:
|
||||
default:
|
||||
return AppLocalizations.of(context).unknownAccount;
|
||||
}
|
||||
}
|
||||
@@ -52,19 +52,19 @@ class _AllAccountsScreenState extends State<AllAccountsScreen> {
|
||||
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];
|
||||
return Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
|
||||
child: _buildAccountCard(user),
|
||||
);
|
||||
},
|
||||
),
|
||||
itemCount: widget.users.length,
|
||||
itemBuilder: (context, index) {
|
||||
final user = widget.users[index];
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16.0, vertical: 8.0),
|
||||
child: _buildAccountCard(user),
|
||||
);
|
||||
},
|
||||
),
|
||||
), // Closing Expanded
|
||||
], // Closing Column
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,9 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
|
||||
width: double.infinity,
|
||||
child: CupertinoSlidingSegmentedControl<int>(
|
||||
groupValue: _selectedCard,
|
||||
thumbColor: Theme.of(context).colorScheme.onPrimary, // Set selected switch color to theme primary color
|
||||
thumbColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.onPrimary, // Set selected switch color to theme primary color
|
||||
onValueChanged: (int? newValue) {
|
||||
if (newValue != null) {
|
||||
setState(() {
|
||||
@@ -112,14 +114,18 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
|
||||
});
|
||||
}
|
||||
},
|
||||
children: {
|
||||
children: {
|
||||
0: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
child: Text(AppLocalizations.of(context).personaldetails),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20, vertical: 10),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).personaldetails),
|
||||
),
|
||||
1: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
child: Text(AppLocalizations.of(context).kycdetails),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20, vertical: 10),
|
||||
child:
|
||||
Text(AppLocalizations.of(context).kycdetails),
|
||||
),
|
||||
},
|
||||
),
|
||||
|
||||
@@ -9,7 +9,6 @@ import 'package:kmobile/features/accounts/screens/all_accounts_screen.dart';
|
||||
import 'package:kmobile/features/auth/controllers/auth_cubit.dart';
|
||||
import 'package:kmobile/features/auth/controllers/auth_state.dart';
|
||||
import 'package:kmobile/features/customer_info/screens/customer_info_screen.dart';
|
||||
import 'package:kmobile/features/cheque/screens/cheque_management_screen.dart';
|
||||
import 'package:kmobile/features/beneficiaries/screens/manage_beneficiaries_screen.dart';
|
||||
import 'package:kmobile/features/enquiry/screens/enquiry_screen.dart';
|
||||
import 'package:kmobile/features/fund_transfer/screens/fund_transfer_screen.dart';
|
||||
@@ -65,8 +64,6 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
Widget _buildAccountCard(User user, bool isSelected) {
|
||||
final theme = Theme.of(context);
|
||||
final bool isCardVisible = _visibilityMap[user.accountNo] ?? false;
|
||||
@@ -78,143 +75,143 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
duration: const Duration(milliseconds: 200),
|
||||
scale: scale,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 18,
|
||||
vertical: 10,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF01A04C),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Top section with account type and number (no refresh button here)
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
getFullAccountType(user.accountType),
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 18,
|
||||
vertical: 10,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF01A04C),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Top section with account type and number (no refresh button here)
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
getFullAccountType(user.accountType),
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
Text(
|
||||
user.accountNo ?? 'N/A',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Text(
|
||||
user.accountNo ?? 'N/A',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
],
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (isSelected) // Show logo only if card is selected
|
||||
CircleAvatar(
|
||||
radius: 20,
|
||||
backgroundColor: Colors.white,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2.0),
|
||||
child: ClipOval(
|
||||
child: Image.asset(
|
||||
'assets/images/logo.png',
|
||||
width: 30,
|
||||
height: 30,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (isSelected) // Show logo only if card is selected
|
||||
CircleAvatar(
|
||||
radius: 20,
|
||||
backgroundColor: Colors.white,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2.0),
|
||||
child: ClipOval(
|
||||
child: Image.asset(
|
||||
'assets/images/logo.png',
|
||||
width: 30,
|
||||
height: 30,
|
||||
fit: BoxFit.cover,
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
// Bottom section with balance and combined toggle/refresh
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
if (isRefreshing && isSelected)
|
||||
Expanded(child: _buildBalanceShimmer())
|
||||
else
|
||||
Expanded(
|
||||
child: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
"₹ ",
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
fontSize: 40,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
isCardVisible
|
||||
? user.currentBalance ?? '0.00'
|
||||
: '*****',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
fontSize: 40,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
// Bottom section with balance and combined toggle/refresh
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
if (isRefreshing && isSelected)
|
||||
Expanded(child: _buildBalanceShimmer())
|
||||
else
|
||||
Expanded(
|
||||
child: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
"₹ ",
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
fontSize: 40,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
isCardVisible
|
||||
? user.currentBalance ?? '0.00'
|
||||
: '*****',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
fontSize: 40,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10), // A steady space
|
||||
if (isSelected) // Only show toggle for selected card
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
if (isRefreshing)
|
||||
return; // Prevent taps while refreshing
|
||||
final accountNo = user.accountNo;
|
||||
if (accountNo == null) return;
|
||||
),
|
||||
const SizedBox(width: 10), // A steady space
|
||||
if (isSelected) // Only show toggle for selected card
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
if (isRefreshing)
|
||||
return; // Prevent taps while refreshing
|
||||
final accountNo = user.accountNo;
|
||||
if (accountNo == null) return;
|
||||
|
||||
final bool currentVisibility =
|
||||
_visibilityMap[accountNo] ?? false;
|
||||
final bool currentVisibility =
|
||||
_visibilityMap[accountNo] ?? false;
|
||||
|
||||
if (!currentVisibility) {
|
||||
// If hidden, refresh data and then show the balance
|
||||
await _refreshAccountData(context);
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_visibilityMap[accountNo] = true;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// If visible, just hide it
|
||||
if (!currentVisibility) {
|
||||
// If hidden, refresh data and then show the balance
|
||||
await _refreshAccountData(context);
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_visibilityMap[accountNo] = false;
|
||||
_visibilityMap[accountNo] = true;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Icon(
|
||||
isCardVisible
|
||||
? Symbols.visibility_lock
|
||||
: Symbols.visibility,
|
||||
color: theme.scaffoldBackgroundColor,
|
||||
weight: 800,
|
||||
),
|
||||
} else {
|
||||
// If visible, just hide it
|
||||
setState(() {
|
||||
_visibilityMap[accountNo] = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Icon(
|
||||
isCardVisible
|
||||
? Symbols.visibility_lock
|
||||
: Symbols.visibility,
|
||||
color: theme.scaffoldBackgroundColor,
|
||||
weight: 800,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -296,7 +293,7 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
return "Cash Credit Account";
|
||||
case 'od':
|
||||
return "Overdraft Account";
|
||||
default:
|
||||
default:
|
||||
return AppLocalizations.of(context).unknownAccount;
|
||||
}
|
||||
}
|
||||
@@ -346,21 +343,19 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final authState = context.read<AuthCubit>().state;
|
||||
String mobileNumberToPass = '';
|
||||
String customerNo = '';
|
||||
String customerName = '';
|
||||
if (authState is Authenticated) {
|
||||
if (selectedAccountIndex >= 0 &&
|
||||
selectedAccountIndex < authState.users.length) {
|
||||
mobileNumberToPass =
|
||||
authState.users[selectedAccountIndex].mobileNo ?? '';
|
||||
customerNo =
|
||||
authState.users[selectedAccountIndex].cifNumber ?? '';
|
||||
customerName =
|
||||
authState.users[selectedAccountIndex].name ?? '';
|
||||
}
|
||||
}
|
||||
final authState = context.read<AuthCubit>().state;
|
||||
String mobileNumberToPass = '';
|
||||
String customerNo = '';
|
||||
String customerName = '';
|
||||
if (authState is Authenticated) {
|
||||
if (selectedAccountIndex >= 0 &&
|
||||
selectedAccountIndex < authState.users.length) {
|
||||
mobileNumberToPass =
|
||||
authState.users[selectedAccountIndex].mobileNo ?? '';
|
||||
customerNo = authState.users[selectedAccountIndex].cifNumber ?? '';
|
||||
customerName = authState.users[selectedAccountIndex].name ?? '';
|
||||
}
|
||||
}
|
||||
return BlocListener<AuthCubit, AuthState>(
|
||||
listener: (context, state) async {
|
||||
if (state is Authenticated && !_biometricPromptShown) {
|
||||
@@ -416,8 +411,6 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
onTap: () {
|
||||
|
||||
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
@@ -431,7 +424,7 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
child: const CircleAvatar(
|
||||
radius: 21,
|
||||
child: Icon(
|
||||
Symbols.person,
|
||||
Symbols.person,
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
@@ -454,8 +447,7 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
// first‐time load
|
||||
if (!_txInitialized) {
|
||||
_txInitialized = true;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
});
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {});
|
||||
}
|
||||
_pageController ??= PageController(
|
||||
initialPage: selectedAccountIndex,
|
||||
@@ -489,11 +481,11 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
child: PageView.builder(
|
||||
clipBehavior: Clip.none,
|
||||
controller: _pageController,
|
||||
itemCount: users.length, // Keep this to show adjacent cards
|
||||
itemCount:
|
||||
users.length, // Keep this to show adjacent cards
|
||||
|
||||
onPageChanged: (int newIndex) async {
|
||||
if (newIndex == selectedAccountIndex)
|
||||
return;
|
||||
if (newIndex == selectedAccountIndex) return;
|
||||
|
||||
// Hide the balance of the old card when scrolling away
|
||||
final oldAccountNo =
|
||||
@@ -508,10 +500,8 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
final user = users[index];
|
||||
final isSelected =
|
||||
index == selectedAccountIndex;
|
||||
return _buildAccountCard(
|
||||
user, isSelected);
|
||||
final isSelected = index == selectedAccountIndex;
|
||||
return _buildAccountCard(user, isSelected);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -524,7 +514,8 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => AllAccountsScreen(users: users),
|
||||
builder: (context) =>
|
||||
AllAccountsScreen(users: users),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -625,8 +616,8 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
selectedIndex: selectedAccountIndex,
|
||||
)));
|
||||
}),
|
||||
_buildQuickLink(Icons.location_pin, AppLocalizations.of(context).branchlocator,
|
||||
() {
|
||||
_buildQuickLink(Icons.location_pin,
|
||||
AppLocalizations.of(context).branchlocator, () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
@@ -658,12 +649,11 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
ProfileScreen(
|
||||
mobileNumber: mobileNumberToPass,
|
||||
customerNo: customerNo,
|
||||
customerName: customerName),
|
||||
),
|
||||
builder: (context) => ProfileScreen(
|
||||
mobileNumber: mobileNumberToPass,
|
||||
customerNo: customerNo,
|
||||
customerName: customerName),
|
||||
),
|
||||
);
|
||||
},
|
||||
disable: false,
|
||||
@@ -684,32 +674,6 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> _buildTransactionShimmer() {
|
||||
final theme = Theme.of(context);
|
||||
return List.generate(3, (i) {
|
||||
return ListTile(
|
||||
leading: Shimmer.fromColors(
|
||||
baseColor: Colors.grey[300]!,
|
||||
highlightColor: Colors.grey[100]!,
|
||||
child: CircleAvatar(
|
||||
radius: 12, backgroundColor: theme.scaffoldBackgroundColor),
|
||||
),
|
||||
title: Shimmer.fromColors(
|
||||
baseColor: Colors.grey[300]!,
|
||||
highlightColor: Colors.grey[100]!,
|
||||
child: Container(
|
||||
height: 10, width: 100, color: theme.scaffoldBackgroundColor),
|
||||
),
|
||||
subtitle: Shimmer.fromColors(
|
||||
baseColor: Colors.grey[300]!,
|
||||
highlightColor: Colors.grey[100]!,
|
||||
child: Container(
|
||||
height: 8, width: 60, color: theme.scaffoldBackgroundColor),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget _buildQuickLink(
|
||||
IconData icon,
|
||||
String label,
|
||||
|
||||
@@ -43,7 +43,8 @@ class FundTransferScreen extends StatelessWidget {
|
||||
child: FundTransferManagementTile(
|
||||
icon: Symbols.person,
|
||||
label: "Self Pay",
|
||||
subtitle: AppLocalizations.of(context).ftselfpaysubtitle,
|
||||
subtitle:
|
||||
AppLocalizations.of(context).ftselfpaysubtitle,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
@@ -86,7 +87,8 @@ class FundTransferScreen extends StatelessWidget {
|
||||
child: FundTransferManagementTile(
|
||||
icon: Symbols.output_circle,
|
||||
label: AppLocalizations.of(context).outsideBank,
|
||||
subtitle: AppLocalizations.of(context).ftoutsidesubtitle,
|
||||
subtitle:
|
||||
AppLocalizations.of(context).ftoutsidesubtitle,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
|
||||
@@ -45,11 +45,9 @@ class _ChangeLimitOTPScreenState extends State<ChangeLimitOTPScreen> {
|
||||
double.parse(widget.newLimit),
|
||||
);
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text("Limit has been Changed"),
|
||||
)
|
||||
);
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
content: Text("Limit has been Changed"),
|
||||
));
|
||||
|
||||
// Navigate back to profile or login
|
||||
Navigator.of(context).popUntil((route) => route.isFirst);
|
||||
|
||||
@@ -172,241 +172,242 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
title: Text(loc.profile),
|
||||
elevation: 0,
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
ListView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
children: [
|
||||
// ===== Profile Header =====
|
||||
Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Row(
|
||||
body: Stack(
|
||||
children: [
|
||||
ListView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
children: [
|
||||
// ===== Profile Header =====
|
||||
Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Row(
|
||||
children: [
|
||||
// Avatar
|
||||
Container(
|
||||
width: 56,
|
||||
height: 56,
|
||||
child: const CircleAvatar(
|
||||
radius: 50,
|
||||
child: Icon(
|
||||
Symbols.person,
|
||||
size: 56,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
// Name + mobile
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Avatar
|
||||
Container(
|
||||
width: 56,
|
||||
height: 56,
|
||||
child: const CircleAvatar(
|
||||
radius: 50,
|
||||
child: Icon(
|
||||
Symbols.person,
|
||||
size: 56,
|
||||
),
|
||||
Text(
|
||||
// If you want to show the user's name instead, replace below.
|
||||
widget.customerName,
|
||||
style: theme.textTheme.titleLarge?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
// Name + mobile
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
// If you want to show the user's name instead, replace below.
|
||||
widget.customerName,
|
||||
style: theme.textTheme.titleLarge?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
widget.customerNo,
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
color: theme.colorScheme.onSurface
|
||||
.withOpacity(0.7),
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
widget.customerNo,
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
color: theme.colorScheme.onSurface
|
||||
.withOpacity(0.7),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// ===== Section: Settings =====
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Text(
|
||||
"Settings",
|
||||
style: theme.textTheme.labelLarge?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: 0.2,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
_SectionTile(
|
||||
leadingIcon: Icons.settings,
|
||||
title: loc.preferences,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const PreferenceScreen(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
_SectionTile(
|
||||
leadingIcon: Icons.security,
|
||||
title: loc.securitySettings,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => SecuritySettingsScreen(
|
||||
mobileNumber: widget.mobileNumber,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
_SectionTile(
|
||||
leadingIcon: Icons.currency_rupee,
|
||||
title: loc.dailylimit,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
DailyLimitScreen(mobileNumber: widget.mobileNumber),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
Card(
|
||||
child: SwitchListTile(
|
||||
title: Text(loc.enableFingerprintLogin),
|
||||
value: _isBiometricEnabled,
|
||||
onChanged: (bool value) {
|
||||
_handleBiometricToggle(value);
|
||||
},
|
||||
secondary: const Icon(Icons.fingerprint),
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 16),
|
||||
const Divider(height: 24),
|
||||
|
||||
// ===== Section: Security & App =====
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Text(
|
||||
loc.appVersion,
|
||||
style: theme.textTheme.labelLarge?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: 0.2,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
// Fingerprint toggle inside a styled container
|
||||
Card(
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.smartphone),
|
||||
title: Text(loc.appVersion),
|
||||
trailing: FutureBuilder<String>(
|
||||
future: _getAppVersion(),
|
||||
builder:
|
||||
(BuildContext context, AsyncSnapshot<String> snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return const SizedBox(
|
||||
width: 18,
|
||||
height: 18,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
);
|
||||
} else if (snapshot.hasError) {
|
||||
return Text(loc.error);
|
||||
} else {
|
||||
return Text(
|
||||
snapshot.data ?? "N/A",
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 16),
|
||||
const Divider(height: 24),
|
||||
|
||||
// ===== Section: Actions =====
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Text(
|
||||
"Exit",
|
||||
style: theme.textTheme.labelLarge?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: 0.2,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
_SectionTile(
|
||||
leadingIcon: Icons.exit_to_app,
|
||||
title: loc.logout,
|
||||
trailChevron: false, // action tile, no chevron
|
||||
onTap: () async {
|
||||
final shouldExit = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(loc.logout),
|
||||
content: Text(loc.logoutCheck),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(loc.no),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: Text(loc.yes),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
if (shouldExit == true) {
|
||||
if (Platform.isAndroid) {
|
||||
SystemNavigator.pop();
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
},
|
||||
),
|
||||
_SectionTile(
|
||||
leadingIcon: Icons.logout,
|
||||
title: loc.deregister,
|
||||
trailChevron: false,
|
||||
onTap: () async {
|
||||
final shouldLogout = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (_) => const LogoutDialog(),
|
||||
);
|
||||
|
||||
if (shouldLogout == true) {
|
||||
await _handleLogout(context);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
), );
|
||||
),
|
||||
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// ===== Section: Settings =====
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Text(
|
||||
"Settings",
|
||||
style: theme.textTheme.labelLarge?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: 0.2,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
_SectionTile(
|
||||
leadingIcon: Icons.settings,
|
||||
title: loc.preferences,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const PreferenceScreen(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
_SectionTile(
|
||||
leadingIcon: Icons.security,
|
||||
title: loc.securitySettings,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => SecuritySettingsScreen(
|
||||
mobileNumber: widget.mobileNumber,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
_SectionTile(
|
||||
leadingIcon: Icons.currency_rupee,
|
||||
title: loc.dailylimit,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
DailyLimitScreen(mobileNumber: widget.mobileNumber),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
Card(
|
||||
child: SwitchListTile(
|
||||
title: Text(loc.enableFingerprintLogin),
|
||||
value: _isBiometricEnabled,
|
||||
onChanged: (bool value) {
|
||||
_handleBiometricToggle(value);
|
||||
},
|
||||
secondary: const Icon(Icons.fingerprint),
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 16),
|
||||
const Divider(height: 24),
|
||||
|
||||
// ===== Section: Security & App =====
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Text(
|
||||
loc.appVersion,
|
||||
style: theme.textTheme.labelLarge?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: 0.2,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
// Fingerprint toggle inside a styled container
|
||||
Card(
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.smartphone),
|
||||
title: Text(loc.appVersion),
|
||||
trailing: FutureBuilder<String>(
|
||||
future: _getAppVersion(),
|
||||
builder:
|
||||
(BuildContext context, AsyncSnapshot<String> snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return const SizedBox(
|
||||
width: 18,
|
||||
height: 18,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
);
|
||||
} else if (snapshot.hasError) {
|
||||
return Text(loc.error);
|
||||
} else {
|
||||
return Text(
|
||||
snapshot.data ?? "N/A",
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 16),
|
||||
const Divider(height: 24),
|
||||
|
||||
// ===== Section: Actions =====
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Text(
|
||||
"Exit",
|
||||
style: theme.textTheme.labelLarge?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: 0.2,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
_SectionTile(
|
||||
leadingIcon: Icons.exit_to_app,
|
||||
title: loc.logout,
|
||||
trailChevron: false, // action tile, no chevron
|
||||
onTap: () async {
|
||||
final shouldExit = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(loc.logout),
|
||||
content: Text(loc.logoutCheck),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(loc.no),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: Text(loc.yes),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
if (shouldExit == true) {
|
||||
if (Platform.isAndroid) {
|
||||
SystemNavigator.pop();
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
},
|
||||
),
|
||||
_SectionTile(
|
||||
leadingIcon: Icons.logout,
|
||||
title: loc.deregister,
|
||||
trailChevron: false,
|
||||
onTap: () async {
|
||||
final shouldLogout = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (_) => const LogoutDialog(),
|
||||
);
|
||||
|
||||
if (shouldLogout == true) {
|
||||
await _handleLogout(context);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,8 @@ class _ATMLocatorScreenState extends State<ATMLocatorScreen> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(AppLocalizations.of(context).atmlocator), // Title for the app bar
|
||||
title: Text(
|
||||
AppLocalizations.of(context).atmlocator), // Title for the app bar
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
|
||||
@@ -50,7 +50,7 @@ class _FaqsScreenState extends State<FaqsScreen> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(AppLocalizations.of(context).faq),
|
||||
title: Text(AppLocalizations.of(context).faq),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user