Customerf Info page changed and landing page changed
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:kmobile/data/models/user.dart';
|
import 'package:kmobile/data/models/user.dart';
|
||||||
@@ -13,6 +14,7 @@ class CustomerInfoScreen extends StatefulWidget {
|
|||||||
|
|
||||||
class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
|
class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
|
||||||
late final User user = widget.user;
|
late final User user = widget.user;
|
||||||
|
int _selectedCard = 0; // 0 for Personal Info, 1 for KYC
|
||||||
|
|
||||||
String _maskPrimaryId(String? primaryId) {
|
String _maskPrimaryId(String? primaryId) {
|
||||||
if (primaryId == null || primaryId.length <= 4) {
|
if (primaryId == null || primaryId.length <= 4) {
|
||||||
@@ -97,6 +99,33 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
// Toggle Buttons for Personal Info and KYC
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: CupertinoSlidingSegmentedControl<int>(
|
||||||
|
groupValue: _selectedCard,
|
||||||
|
thumbColor: Theme.of(context).colorScheme.onPrimary, // Set selected switch color to theme primary color
|
||||||
|
onValueChanged: (int? newValue) {
|
||||||
|
if (newValue != null) {
|
||||||
|
setState(() {
|
||||||
|
_selectedCard = newValue;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
children: {
|
||||||
|
0: Padding(
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
// Card that shows content based on the toggle
|
||||||
Card(
|
Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
@@ -108,46 +137,11 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
|
|||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Column(
|
child: AnimatedSwitcher(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
duration: const Duration(milliseconds: 300),
|
||||||
children: [
|
child: _selectedCard == 0
|
||||||
Text(
|
? _buildPersonalInfo(theme)
|
||||||
'Personal Information',
|
: _buildKycDetails(theme),
|
||||||
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),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -173,6 +167,64 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
|
|||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildPersonalInfo(ThemeData theme) {
|
||||||
|
return Column(
|
||||||
|
key: const ValueKey('personal_info'),
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context).personaldetails,
|
||||||
|
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',
|
||||||
|
),
|
||||||
|
InfoField(
|
||||||
|
label: AppLocalizations.of(context).branchCode,
|
||||||
|
value: user.branchId ?? 'N/A',
|
||||||
|
),
|
||||||
|
InfoField(
|
||||||
|
label: AppLocalizations.of(context).address,
|
||||||
|
value: user.address ?? 'N/A',
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildKycDetails(ThemeData theme) {
|
||||||
|
return Column(
|
||||||
|
key: const ValueKey('kyc_details'),
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context).kycdetails,
|
||||||
|
style: theme.textTheme.titleMedium?.copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
InfoField(
|
||||||
|
label: AppLocalizations.of(context).primaryId,
|
||||||
|
value: _maskPrimaryId(user.primaryId),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class InfoField extends StatelessWidget {
|
class InfoField extends StatelessWidget {
|
||||||
|
|||||||
@@ -403,58 +403,68 @@ class _DashboardScreenState extends State<DashboardScreen>
|
|||||||
backgroundColor: theme.scaffoldBackgroundColor,
|
backgroundColor: theme.scaffoldBackgroundColor,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: theme.scaffoldBackgroundColor,
|
backgroundColor: theme.scaffoldBackgroundColor,
|
||||||
leading: Padding(
|
leading: const Padding(
|
||||||
padding: const EdgeInsets.only(left: 10.0),
|
padding: EdgeInsets.only(left: 10.0),
|
||||||
child: InkWell(
|
child: CircleAvatar(
|
||||||
borderRadius: BorderRadius.circular(20),
|
radius: 15,
|
||||||
onTap: () {
|
backgroundImage: AssetImage('assets/images/logo.png'),
|
||||||
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 ?? '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) => ProfileScreen(
|
|
||||||
mobileNumber: mobileNumberToPass,
|
|
||||||
customerNo: customerNo,
|
|
||||||
customerName: customerName),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: CircleAvatar(
|
|
||||||
backgroundColor: Colors.grey[200],
|
|
||||||
radius: 20,
|
|
||||||
child: SvgPicture.asset(
|
|
||||||
'assets/images/avatar_male.svg',
|
|
||||||
width: 40,
|
|
||||||
height: 40,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
AppLocalizations.of(context).kccbMobile,
|
AppLocalizations.of(context).kccBankFull.replaceAll('-', '\u2011'),
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.center,
|
||||||
|
softWrap: true, // Explicitly allow wrapping
|
||||||
|
maxLines: 2, // Allow text to wrap to a maximum of 2 lines
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: theme.colorScheme.primary,
|
color: theme.colorScheme.primary,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
centerTitle: true,
|
// Removed centerTitle: true to give more space for text wrapping
|
||||||
|
|
||||||
|
actions: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 10.0),
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
onTap: () {
|
||||||
|
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 ?? '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => ProfileScreen(
|
||||||
|
mobileNumber: mobileNumberToPass,
|
||||||
|
customerNo: customerNo,
|
||||||
|
customerName: customerName),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: CircleAvatar(
|
||||||
|
backgroundColor: Colors.grey[200],
|
||||||
|
radius: 21,
|
||||||
|
child: SvgPicture.asset(
|
||||||
|
'assets/images/avatar_male.svg',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
body: BlocBuilder<AuthCubit, AuthState>(
|
body: BlocBuilder<AuthCubit, AuthState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
@@ -486,6 +496,7 @@ class _DashboardScreenState extends State<DashboardScreen>
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
const SizedBox(height: 16), // Added spacing
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 8.0),
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ class _ATMLocatorScreenState extends State<ATMLocatorScreen> {
|
|||||||
return Card(
|
return Card(
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
leading: const Icon(Icons.currency_rupee), // Icon for ATM
|
leading: const Icon(Icons.credit_card), // Icon for ATM
|
||||||
title: Text(atm.name, // Display the ATM's name
|
title: Text(atm.name, // Display the ATM's name
|
||||||
style: const TextStyle(fontWeight: FontWeight.bold)),
|
style: const TextStyle(fontWeight: FontWeight.bold)),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ class _BranchLocatorScreenState extends State<BranchLocatorScreen> {
|
|||||||
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
leading: const CircleAvatar(
|
leading: const CircleAvatar(
|
||||||
child: Icon(Icons.location_city),
|
child: Icon(Icons.account_balance),
|
||||||
),
|
),
|
||||||
title: Text(branch.branch_name,
|
title: Text(branch.branch_name,
|
||||||
style: const TextStyle(fontWeight: FontWeight.bold)),
|
style: const TextStyle(fontWeight: FontWeight.bold)),
|
||||||
|
|||||||
@@ -225,7 +225,7 @@
|
|||||||
"pinMismatch": "PINs do not match",
|
"pinMismatch": "PINs do not match",
|
||||||
"securitySettings": "Security Settings",
|
"securitySettings": "Security Settings",
|
||||||
"kconnect": "Kconnect",
|
"kconnect": "Kconnect",
|
||||||
"kccBankFull": "Kangra Central Co-operative Bank",
|
"kccBankFull": "The Kangra Central Co-operative Bank Ltd.",
|
||||||
"themeColor": "Theme Color",
|
"themeColor": "Theme Color",
|
||||||
"selectThemeColor": "Select Theme Color",
|
"selectThemeColor": "Select Theme Color",
|
||||||
"violet": "Violet",
|
"violet": "Violet",
|
||||||
@@ -411,5 +411,7 @@
|
|||||||
"quickoutsidesubtitle": "Transfer funds to any bank across India with ease. Your transactions are secure and processed quickly",
|
"quickoutsidesubtitle": "Transfer funds to any bank across India with ease. Your transactions are secure and processed quickly",
|
||||||
"ftselfpaysubtitle": "Move money between your own accounts with ease. Your funds, your way",
|
"ftselfpaysubtitle": "Move money between your own accounts with ease. Your funds, your way",
|
||||||
"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",
|
||||||
|
"kycdetails": "KYC Details"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -412,5 +412,7 @@
|
|||||||
"quickoutsidesubtitle": "भारत भर में किसी भी बैंक में आसानी से धनराशि स्थानांतरित करें। आपके लेन-देन सुरक्षित और शीघ्रता से संसाधित होते हैं",
|
"quickoutsidesubtitle": "भारत भर में किसी भी बैंक में आसानी से धनराशि स्थानांतरित करें। आपके लेन-देन सुरक्षित और शीघ्रता से संसाधित होते हैं",
|
||||||
"ftselfpaysubtitle": "अपने खातों के बीच आसानी से पैसे ट्रांसफर करें। आपका पैसा, आपकी सुविधानुसार",
|
"ftselfpaysubtitle": "अपने खातों के बीच आसानी से पैसे ट्रांसफर करें। आपका पैसा, आपकी सुविधानुसार",
|
||||||
"ftownsubtitle": "कांगड़ा बैंक के माध्यम से अपने बचत लाभार्थियों को पैसे भेजें",
|
"ftownsubtitle": "कांगड़ा बैंक के माध्यम से अपने बचत लाभार्थियों को पैसे भेजें",
|
||||||
"ftoutsidesubtitle": "भारत भर में किसी भी अन्य बैंक में अपने सहेजे गए लाभार्थियों को धनराशि हस्तांतरित करें"
|
"ftoutsidesubtitle": "भारत भर में किसी भी अन्य बैंक में अपने सहेजे गए लाभार्थियों को धनराशि हस्तांतरित करें",
|
||||||
|
"personaldetails": "व्यक्तिगत विवरण",
|
||||||
|
"kycdetails": "केवाईसी विवरण"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user