Masking of Primary ID and Compliant Form Link created

This commit is contained in:
2025-10-13 18:10:39 +05:30
parent 39e7a02ca5
commit d36cad31c1
2 changed files with 46 additions and 15 deletions

View File

@@ -13,6 +13,15 @@ class CustomerInfoScreen extends StatefulWidget {
class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
late final User user = widget.user;
String _maskPrimaryId(String? primaryId) {
if (primaryId == null || primaryId.length <= 4) {
return primaryId ?? 'N/A';
}
final lastFour = primaryId.substring(primaryId.length - 4);
return '*' * (primaryId.length - 4) + lastFour;
}
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
@@ -83,10 +92,10 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
label: AppLocalizations.of(context).branchAddress,
value: user.address ?? 'N/A',
), // Replace with Aadhar if available
InfoField(
label: AppLocalizations.of(context).primaryId,
value: user.primaryId ?? 'N/A',
), // Replace with PAN if available
InfoField(
label: AppLocalizations.of(context).primaryId,
value: _maskPrimaryId(user.primaryId),
), // Replace with PAN if available
],
),
),