From fae41a2f7e1b92317fdd59695126d05960f1d7e1 Mon Sep 17 00:00:00 2001 From: venba-Inspriron-3558 Date: Mon, 23 Jun 2025 16:27:27 +0530 Subject: [PATCH] minor issues fixes 2 --- lib/Screens/reports/misForex.dart | 7 --- .../create_user/personal_details.dart | 55 +++++++++++++++---- 2 files changed, 44 insertions(+), 18 deletions(-) diff --git a/lib/Screens/reports/misForex.dart b/lib/Screens/reports/misForex.dart index 7896f8e..62c3fe5 100644 --- a/lib/Screens/reports/misForex.dart +++ b/lib/Screens/reports/misForex.dart @@ -314,13 +314,6 @@ class _MISforexState extends State fontSize: 18.0, webBgColor: "linear-gradient(to right, $displayBackgroundColor, $displayBackgroundColor)", ); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - backgroundColor: result['status'] ? Colors.green : Colors.red, - content: Text(result['message']), - behavior: SnackBarBehavior.floating, - ), - ); } void handleInternationalFilter(String query) { diff --git a/lib/Screens/userManagement/create_user/personal_details.dart b/lib/Screens/userManagement/create_user/personal_details.dart index 5d6a4d5..6f49b7a 100644 --- a/lib/Screens/userManagement/create_user/personal_details.dart +++ b/lib/Screens/userManagement/create_user/personal_details.dart @@ -990,17 +990,45 @@ class PersonalDetailsState extends State { fit: FlexFit.loose, constraints: BoxConstraints(maxHeight: 200), itemBuilder: - (context, item, isSelected) => Container( - color: Colors.white, - padding: EdgeInsets.symmetric( - horizontal: 10, - vertical: 6, - ), - child: Text( - item, - style: GoogleFonts.poppins(fontSize: 11.5), + // (context, item, isSelected) => Container( + // color: Colors.white, + // padding: EdgeInsets.symmetric( + // horizontal: 10, + // vertical: 6, + // ), + // child: Text( + // item, + // style: GoogleFonts.poppins(fontSize: 11.5), + // ), + // ), + (context, item, isSelected) { + print("contryItem - $item"); + final match = RegExp(r'^(.*)\s\((.*)\)$',).firstMatch(item); + final countryName = match?.group(1) ?? ''; + final countryCode = match?.group(2) ?? ''; + return Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0, + vertical: 6.0, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + countryName, + style: GoogleFonts.poppins(fontSize: 11.5), + ), + Text( + countryCode, + style: GoogleFonts.poppins(fontSize: 11.5,color:Colors.grey), + + ), + ], ), ), + );}, ), items: genderOptions, dropdownDecoratorProps: DropDownDecoratorProps( @@ -1300,9 +1328,14 @@ class PersonalDetailsState extends State { countryList = apiCountryData ?? []; // Map country codes to country names + // countryMap = { + // for (var item in countryList) + // item['country_code'] as String: item['country_name'] as String, + // }; countryMap = { - for (var item in countryList) - item['country_code'] as String: item['country_name'] as String, + for (var country in countryList) + (country['country_code'] ?? ''): + '${country['country_name'] ?? ''} (${country['country_code'] ?? ''})', }; // Extract only country codes for processing