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,44 +33,89 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
.replaceFirst(RegExp('\n'), ''), .replaceFirst(RegExp('\n'), ''),
), ),
), ),
body: Stack( body: SafeArea(
child: Stack(
children: [ children: [
SingleChildScrollView( SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
child: Padding( child: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: SafeArea(
child: Center(
child: Column( child: Column(
children: [ children: [
const SizedBox(height: 30), Card(
CircleAvatar( elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
side: BorderSide(
color: theme.colorScheme.outline.withOpacity(0.2),
width: 1,
),
),
child: Padding( padding: const EdgeInsets.all(16.0),
child: Row(
children: [
SizedBox(
width: 56,
height: 56,
child: CircleAvatar(
radius: 50, radius: 50,
child: SvgPicture.asset( child: SvgPicture.asset(
'assets/images/avatar_male.svg', 'assets/images/avatar_male.svg',
width: 150,
height: 150,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
Padding(
padding: const EdgeInsets.only(top: 10.0),
child: Text(
user.name ?? '',
style: TextStyle(
fontSize: 20,
color: theme.colorScheme.onSurface,
fontWeight: FontWeight.w500,
),
),
), ),
const SizedBox(width: 12),
// Name + mobile
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text( Text(
'${AppLocalizations.of(context).cif}: ${user.cifNumber ?? 'N/A'}', // If you want to show the user's name instead, replace below.
style: TextStyle( user.name ?? '',
fontSize: 16, style:
color: theme.colorScheme.onSurfaceVariant), theme.textTheme.titleLarge?.copyWith(
fontWeight: FontWeight.w600,
), ),
const SizedBox(height: 30), ),
const SizedBox(height: 4),
Text(
user.cifNumber ?? '',
style: theme.textTheme.bodyMedium?.copyWith(
color: theme.colorScheme.onSurface
.withOpacity(0.7),
),
),
],
),
),
],
),
),
),
const SizedBox(height: 16),
Card(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
side: BorderSide(
color: theme.colorScheme.outline.withOpacity(0.2),
width: 1,
),
),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Personal Information',
style: theme.textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 16),
InfoField( InfoField(
label: AppLocalizations.of(context).activeAccounts, label: AppLocalizations.of(context).activeAccounts,
value: user.activeAccounts?.toString() ?? 'N/A', value: user.activeAccounts?.toString() ?? 'N/A',
@@ -97,11 +142,13 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
InfoField( InfoField(
label: AppLocalizations.of(context).primaryId, label: AppLocalizations.of(context).primaryId,
value: _maskPrimaryId(user.primaryId), value: _maskPrimaryId(user.primaryId),
), // Replace with PAN if available ),
], ],
), ),
), ),
), ),
],
),
), ),
), ),
IgnorePointer( IgnorePointer(
@@ -120,6 +167,7 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
), ),
], ],
), ),
)
); );
} }
} }
@@ -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,17 +23,16 @@ 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(
margin: const EdgeInsets.only(bottom: 10),
child: ListTile(
leading: const Icon(Icons.language), leading: const Icon(Icons.language),
title: Text(loc.language), title: Text(loc.language),
trailing: const Icon(Icons.chevron_right),
onTap: () { onTap: () {
showDialog( showDialog(
context: context, context: context,
@@ -41,24 +40,33 @@ class PreferenceScreen extends StatelessWidget {
); );
}, },
), ),
),
//Theme Mode Switch (Light/Dark) //Theme Mode Switch (Light/Dark)
ListTile( Card(
margin: const EdgeInsets.only(bottom: 10),
child: ListTile(
leading: const Icon(Icons.brightness_6), leading: const Icon(Icons.brightness_6),
title: Text(AppLocalizations.of(context).themeMode), title: Text(AppLocalizations.of(context).themeMode),
trailing: const Icon(Icons.chevron_right),
onTap: () { onTap: () {
showThemeModeDialog(context); showThemeModeDialog(context);
}, },
), ),
),
//Color_Theme_Selection //Color_Theme_Selection
ListTile( Card(
margin: const EdgeInsets.only(bottom: 10),
child: ListTile(
leading: const Icon(Icons.color_lens), leading: const Icon(Icons.color_lens),
title: Text(AppLocalizations.of(context).themeColor), title: Text(AppLocalizations.of(context).themeColor),
trailing: const Icon(Icons.chevron_right),
onTap: () { onTap: () {
showDialog( showDialog(
context: context, context: context,
builder: (_) => const ColorThemeDialog(), 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,11 +189,10 @@ 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,
), ),
), ),
@@ -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,8 +24,11 @@ class SecuritySettingsScreen extends StatelessWidget {
body: Stack( body: Stack(
children: [ children: [
ListView( ListView(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
children: [ children: [
ListTile( Card(
margin: const EdgeInsets.only(bottom: 10),
child: ListTile(
leading: const Icon(Icons.lock_outline), leading: const Icon(Icons.lock_outline),
title: Text(loc.changeLoginPassword), title: Text(loc.changeLoginPassword),
trailing: const Icon(Icons.chevron_right), trailing: const Icon(Icons.chevron_right),
@@ -40,8 +43,10 @@ class SecuritySettingsScreen extends StatelessWidget {
); );
}, },
), ),
Divider(height: 1, color: Theme.of(context).dividerColor), ),
ListTile( Card(
margin: const EdgeInsets.only(bottom: 10),
child: ListTile(
leading: const Icon(Icons.pin), leading: const Icon(Icons.pin),
title: Text(loc.changeMpin), title: Text(loc.changeMpin),
trailing: const Icon(Icons.chevron_right), trailing: const Icon(Icons.chevron_right),
@@ -64,8 +69,10 @@ class SecuritySettingsScreen extends StatelessWidget {
} }
}, },
), ),
Divider(height: 1, color: Theme.of(context).dividerColor), ),
ListTile( Card(
margin: const EdgeInsets.only(bottom: 10),
child: ListTile(
leading: const Icon(Icons.password), leading: const Icon(Icons.password),
title: const Text('Change TPIN'), title: const Text('Change TPIN'),
trailing: const Icon(Icons.chevron_right), trailing: const Icon(Icons.chevron_right),
@@ -118,6 +125,7 @@ class SecuritySettingsScreen extends StatelessWidget {
} }
}, },
), ),
),
], ],
), ),
IgnorePointer( IgnorePointer(

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