Profile Changed and Customer Info

This commit is contained in:
2025-11-28 11:28:01 +05:30
parent b19bc2e222
commit 04a1ce26ec
7 changed files with 274 additions and 220 deletions

BIN
assets/images/profile.svg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -74,9 +74,9 @@ Dio _createDioClient() {
final dio = Dio( final dio = Dio(
BaseOptions( BaseOptions(
baseUrl: baseUrl:
'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080', //test //'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080', //test
//'http://lb-kccb-mobile-banking-app-848675342.ap-south-1.elb.amazonaws.com', //prod //'http://lb-kccb-mobile-banking-app-848675342.ap-south-1.elb.amazonaws.com', //prod
//'https://kccbmbnk.net', //prod small 'https://kccbmbnk.net', //prod small
connectTimeout: const Duration(seconds: 60), connectTimeout: const Duration(seconds: 60),
receiveTimeout: const Duration(seconds: 60), receiveTimeout: const Duration(seconds: 60),
headers: { headers: {

View File

@@ -33,93 +33,141 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
.replaceFirst(RegExp('\n'), ''), .replaceFirst(RegExp('\n'), ''),
), ),
), ),
body: Stack( body: SafeArea(
children: [ child: Stack(
SingleChildScrollView( children: [
physics: const AlwaysScrollableScrollPhysics(), SingleChildScrollView(
child: Padding( physics: const AlwaysScrollableScrollPhysics(),
padding: const EdgeInsets.all(16.0), child: Padding(
child: SafeArea( padding: const EdgeInsets.all(16.0),
child: Center( child: Column(
child: Column( children: [
children: [ Card(
const SizedBox(height: 30), elevation: 0,
CircleAvatar( shape: RoundedRectangleBorder(
radius: 50, borderRadius: BorderRadius.circular(12),
child: SvgPicture.asset( side: BorderSide(
'assets/images/avatar_male.svg', color: theme.colorScheme.outline.withOpacity(0.2),
width: 150, width: 1,
height: 150, ),
fit: BoxFit.cover, ),
child: Padding( padding: const EdgeInsets.all(16.0),
child: Row(
children: [
SizedBox(
width: 56,
height: 56,
child: CircleAvatar(
radius: 50,
child: SvgPicture.asset(
'assets/images/avatar_male.svg',
fit: BoxFit.cover,
),
),
),
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.
user.name ?? '',
style:
theme.textTheme.titleLarge?.copyWith(
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 4),
Text(
user.cifNumber ?? '',
style: theme.textTheme.bodyMedium?.copyWith(
color: theme.colorScheme.onSurface
.withOpacity(0.7),
),
),
],
),
),
],
), ),
), ),
Padding( ),
padding: const EdgeInsets.only(top: 10.0), const SizedBox(height: 16),
child: Text( Card(
user.name ?? '', elevation: 0,
style: TextStyle( shape: RoundedRectangleBorder(
fontSize: 20, borderRadius: BorderRadius.circular(12),
color: theme.colorScheme.onSurface, side: BorderSide(
fontWeight: FontWeight.w500, color: theme.colorScheme.outline.withOpacity(0.2),
), width: 1,
), ),
), ),
Text( child: Padding(
'${AppLocalizations.of(context).cif}: ${user.cifNumber ?? 'N/A'}', padding: const EdgeInsets.all(16.0),
style: TextStyle( child: Column(
fontSize: 16, crossAxisAlignment: CrossAxisAlignment.start,
color: theme.colorScheme.onSurfaceVariant), children: [
Text(
'Personal Information',
style: theme.textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 16),
InfoField(
label: AppLocalizations.of(context).activeAccounts,
value: user.activeAccounts?.toString() ?? 'N/A',
),
InfoField(
label: AppLocalizations.of(context).mobileNumber,
value: user.mobileNo ?? 'N/A',
),
InfoField(
label: AppLocalizations.of(context).dateOfBirth,
value: (user.dateOfBirth != null &&
user.dateOfBirth!.length == 8)
? '${user.dateOfBirth!.substring(0, 2)}-${user.dateOfBirth!.substring(2, 4)}-${user.dateOfBirth!.substring(4, 8)}'
: 'N/A',
), // Replace with DOB if available
InfoField(
label: AppLocalizations.of(context).branchCode,
value: user.branchId ?? 'N/A',
),
InfoField(
label: AppLocalizations.of(context).address,
value: user.address ?? 'N/A',
), // Replace with Aadhar if available
InfoField(
label: AppLocalizations.of(context).primaryId,
value: _maskPrimaryId(user.primaryId),
),
],
),
), ),
const SizedBox(height: 30), ),
InfoField( ],
label: AppLocalizations.of(context).activeAccounts, ),
value: user.activeAccounts?.toString() ?? 'N/A', ),
), ),
InfoField( IgnorePointer(
label: AppLocalizations.of(context).mobileNumber, child: Center(
value: user.mobileNo ?? 'N/A', child: Opacity(
), opacity: 0.07, // Reduced opacity
InfoField( child: ClipOval(
label: AppLocalizations.of(context).dateOfBirth, child: Image.asset(
value: (user.dateOfBirth != null && 'assets/images/logo.png',
user.dateOfBirth!.length == 8) width: 200, // Adjust size as needed
? '${user.dateOfBirth!.substring(0, 2)}-${user.dateOfBirth!.substring(2, 4)}-${user.dateOfBirth!.substring(4, 8)}' height: 200, // Adjust size as needed
: 'N/A', ),
), // Replace with DOB if available
InfoField(
label: AppLocalizations.of(context).branchCode,
value: user.branchId ?? 'N/A',
),
InfoField(
label: AppLocalizations.of(context).address,
value: user.address ?? 'N/A',
), // Replace with Aadhar if available
InfoField(
label: AppLocalizations.of(context).primaryId,
value: _maskPrimaryId(user.primaryId),
), // Replace with PAN if available
],
), ),
), ),
), ),
), ),
), ],
IgnorePointer( ),
child: Center( )
child: Opacity(
opacity: 0.07, // Reduced opacity
child: ClipOval(
child: Image.asset(
'assets/images/logo.png',
width: 200, // Adjust size as needed
height: 200, // Adjust size as needed
),
),
),
),
),
],
),
); );
} }
} }
@@ -141,16 +189,16 @@ class InfoField extends StatelessWidget {
children: [ children: [
Text( Text(
label, label,
style: TextStyle( style: theme.textTheme.bodySmall?.copyWith(
fontSize: 15, color: theme.colorScheme.onSurface.withOpacity(0.6),
fontWeight: FontWeight.w500,
color: theme.colorScheme.onSurfaceVariant,
), ),
), ),
const SizedBox(height: 3), const SizedBox(height: 4),
Text( Text(
value, value.isEmpty ? 'N/A' : value,
style: TextStyle(fontSize: 16, color: theme.colorScheme.onSurface), style: theme.textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.w600,
),
), ),
], ],
), ),

View File

@@ -23,42 +23,50 @@ class PreferenceScreen extends StatelessWidget {
return Stack( return Stack(
children: [ children: [
ListView( ListView(
padding:
const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
children: [ children: [
//Set Prefered Username
// ListTile(
// leading: const Icon(Icons.person),
// title: const Text("Set Prefered Username"),
// onTap: () {
// }),
// Language Selection // Language Selection
ListTile( Card(
leading: const Icon(Icons.language), margin: const EdgeInsets.only(bottom: 10),
title: Text(loc.language), child: ListTile(
onTap: () { leading: const Icon(Icons.language),
showDialog( title: Text(loc.language),
context: context, trailing: const Icon(Icons.chevron_right),
builder: (_) => const LanguageDialog(),
);
},
),
//Theme Mode Switch (Light/Dark)
ListTile(
leading: const Icon(Icons.brightness_6),
title: Text(AppLocalizations.of(context).themeMode),
onTap: () {
showThemeModeDialog(context);
},
),
//Color_Theme_Selection
ListTile(
leading: const Icon(Icons.color_lens),
title: Text(AppLocalizations.of(context).themeColor),
onTap: () { onTap: () {
showDialog( showDialog(
context: context, context: context,
builder: (_) => const ColorThemeDialog(), builder: (_) => const LanguageDialog(),
); );
}), },
),
),
//Theme Mode Switch (Light/Dark)
Card(
margin: const EdgeInsets.only(bottom: 10),
child: ListTile(
leading: const Icon(Icons.brightness_6),
title: Text(AppLocalizations.of(context).themeMode),
trailing: const Icon(Icons.chevron_right),
onTap: () {
showThemeModeDialog(context);
},
),
),
//Color_Theme_Selection
Card(
margin: const EdgeInsets.only(bottom: 10),
child: ListTile(
leading: const Icon(Icons.color_lens),
title: Text(AppLocalizations.of(context).themeColor),
trailing: const Icon(Icons.chevron_right),
onTap: () {
showDialog(
context: context,
builder: (_) => const ColorThemeDialog(),
);
}),
),
], ],
), ),
IgnorePointer( IgnorePointer(

View File

@@ -1,6 +1,7 @@
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:kmobile/data/repositories/auth_repository.dart'; import 'package:kmobile/data/repositories/auth_repository.dart';
import 'package:kmobile/features/profile/daily_transaction_limit.dart'; import 'package:kmobile/features/profile/daily_transaction_limit.dart';
import 'package:kmobile/features/profile/logout_dialog.dart'; import 'package:kmobile/features/profile/logout_dialog.dart';
@@ -188,15 +189,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
Container( Container(
width: 56, width: 56,
height: 56, height: 56,
decoration: BoxDecoration( child: CircleAvatar(
shape: BoxShape.circle, radius: 50,
color: theme.colorScheme.surface, child: SvgPicture.asset(
image: const DecorationImage( 'assets/images/avatar_male.svg',
image: AssetImage('assets/images/logo.png'), fit: BoxFit.cover,
fit: BoxFit.cover,
),
), ),
), ),
),
const SizedBox(width: 12), const SizedBox(width: 12),
// Name + mobile // Name + mobile
Expanded( Expanded(
@@ -221,17 +221,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
], ],
), ),
), ),
// Edit/Profile button (optional)
TextButton.icon(
onPressed: () {
// TODO: Navigate to edit profile if required
},
icon: const Icon(Icons.edit, size: 18),
label: const Text("Edit"),
style: TextButton.styleFrom(
foregroundColor: theme.colorScheme.onSurface,
),
),
], ],
), ),
), ),

View File

@@ -24,99 +24,107 @@ class SecuritySettingsScreen extends StatelessWidget {
body: Stack( body: Stack(
children: [ children: [
ListView( ListView(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
children: [ children: [
ListTile( Card(
leading: const Icon(Icons.lock_outline), margin: const EdgeInsets.only(bottom: 10),
title: Text(loc.changeLoginPassword), child: ListTile(
trailing: const Icon(Icons.chevron_right), leading: const Icon(Icons.lock_outline),
onTap: () { title: Text(loc.changeLoginPassword),
Navigator.push( trailing: const Icon(Icons.chevron_right),
context, onTap: () {
MaterialPageRoute( Navigator.push(
builder: (context) => ChangePasswordScreen( context,
mobileNumber: mobileNumber, MaterialPageRoute(
), builder: (context) => ChangePasswordScreen(
), mobileNumber: mobileNumber,
); ),
},
),
Divider(height: 1, color: Theme.of(context).dividerColor),
ListTile(
leading: const Icon(Icons.pin),
title: Text(loc.changeMpin),
trailing: const Icon(Icons.chevron_right),
onTap: () async {
final result = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ChangeMpinScreen(),
),
);
if (result == true && context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(loc.mpinChangedSuccessfully),
backgroundColor:
Theme.of(context).colorScheme.secondary,
), ),
); );
} },
}, ),
), ),
Divider(height: 1, color: Theme.of(context).dividerColor), Card(
ListTile( margin: const EdgeInsets.only(bottom: 10),
leading: const Icon(Icons.password), child: ListTile(
title: const Text('Change TPIN'), leading: const Icon(Icons.pin),
trailing: const Icon(Icons.chevron_right), title: Text(loc.changeMpin),
onTap: () async { trailing: const Icon(Icons.chevron_right),
final authService = getIt<AuthService>(); onTap: () async {
final isTpinSet = await authService.checkTpin(); final result = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ChangeMpinScreen(),
),
);
if (!isTpinSet) { if (result == true && context.mounted) {
if (context.mounted) { ScaffoldMessenger.of(context).showSnackBar(
showDialog( SnackBar(
context: context, content: Text(loc.mpinChangedSuccessfully),
builder: (BuildContext context) { backgroundColor:
return AlertDialog( Theme.of(context).colorScheme.secondary,
title: const Text('TPIN Not Set'),
content: const Text(
'You have not set a TPIN yet. Please set a TPIN to proceed.'),
actions: <Widget>[
TextButton(
child: const Text('Back'),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: const Text('Proceed'),
onPressed: () {
Navigator.of(context).pop();
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
const TpinSetScreen(),
),
);
},
),
],
);
},
);
}
} else {
if (context.mounted) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
ChangeTpinScreen(mobileNumber: mobileNumber),
), ),
); );
} }
} },
}, ),
),
Card(
margin: const EdgeInsets.only(bottom: 10),
child: ListTile(
leading: const Icon(Icons.password),
title: const Text('Change TPIN'),
trailing: const Icon(Icons.chevron_right),
onTap: () async {
final authService = getIt<AuthService>();
final isTpinSet = await authService.checkTpin();
if (!isTpinSet) {
if (context.mounted) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('TPIN Not Set'),
content: const Text(
'You have not set a TPIN yet. Please set a TPIN to proceed.'),
actions: <Widget>[
TextButton(
child: const Text('Back'),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: const Text('Proceed'),
onPressed: () {
Navigator.of(context).pop();
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
const TpinSetScreen(),
),
);
},
),
],
);
},
);
}
} else {
if (context.mounted) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
ChangeTpinScreen(mobileNumber: mobileNumber),
),
);
}
}
},
),
), ),
], ],
), ),

View File

@@ -114,6 +114,7 @@ flutter:
- assets/images/yes_bank_logo.png - assets/images/yes_bank_logo.png
- assets/images/uco_logo.png - assets/images/uco_logo.png
- assets/images/ipos_logo.png - assets/images/ipos_logo.png
- assets/images/profile.svg
- assets/animations/rupee.json - assets/animations/rupee.json
- assets/animations/error.json - assets/animations/error.json
- assets/animations/done.json - assets/animations/done.json