diff --git a/lib/features/customer_info/screens/customer_info_screen.dart b/lib/features/customer_info/screens/customer_info_screen.dart index 117e753..f561b38 100644 --- a/lib/features/customer_info/screens/customer_info_screen.dart +++ b/lib/features/customer_info/screens/customer_info_screen.dart @@ -13,6 +13,15 @@ class CustomerInfoScreen extends StatefulWidget { class _CustomerInfoScreenState extends State { 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 { 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 ], ), ), diff --git a/lib/features/enquiry/screens/enquiry_screen.dart b/lib/features/enquiry/screens/enquiry_screen.dart index b772168..158d832 100644 --- a/lib/features/enquiry/screens/enquiry_screen.dart +++ b/lib/features/enquiry/screens/enquiry_screen.dart @@ -30,6 +30,16 @@ class _EnquiryScreen extends State { } } + Future _launchUrl(String url) async { + final Uri uri = Uri.parse(url); + if (await canLaunchUrl(uri)) { + await launchUrl(uri); + } else { + // Consider adding a 'urlLaunchError' key to your AppLocalizations + debugPrint('Could not launch $url'); + } + } + Widget _buildContactItem(String role, String email, String phone) { return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -65,18 +75,30 @@ class _EnquiryScreen extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // … existing Mail us / Call us / Write to us … - const SizedBox(height: 20), - Text( - AppLocalizations.of(context).writeToUs, - ), - const SizedBox(height: 4), - Text( - "complaint@kccb.in", - style: TextStyle(color: Theme.of(context).colorScheme.primary), - ), + const SizedBox(height: 20), + GestureDetector( + onTap: () => _launchUrl("https://kccb.in/complaint-form"), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text("Complaint Form", + style: TextStyle( + fontSize: 17, + color: Theme.of(context).colorScheme.primary, + decorationColor: Theme.of(context).colorScheme.primary, + ), + ), + const SizedBox(width: 4), + Icon( + Icons.open_in_new, + color: Theme.of(context).colorScheme.primary, + size: 16.0, + ), + ] +) + ), - const SizedBox(height: 20), + const SizedBox(height: 40), Text( AppLocalizations.of(context).keyContacts, style: TextStyle(