From 3d6e9656b4a91c01c44ea32fb46da29f497ad842 Mon Sep 17 00:00:00 2001 From: SurendarSuri30 Date: Thu, 21 Aug 2025 09:50:02 +0530 Subject: [PATCH] ticket merge issue fix --- lib/pages/postEnrollment/tickets.dart | 360 ++++++++---------- macos/Flutter/GeneratedPluginRegistrant.swift | 2 +- 2 files changed, 163 insertions(+), 199 deletions(-) diff --git a/lib/pages/postEnrollment/tickets.dart b/lib/pages/postEnrollment/tickets.dart index 3bfa994..0c35b40 100644 --- a/lib/pages/postEnrollment/tickets.dart +++ b/lib/pages/postEnrollment/tickets.dart @@ -31,6 +31,7 @@ class _ticketsState extends State { dynamic policyDataIsEmpty = 1; int? fromClaimsPage; dynamic decodedToken; + List> departmentList = []; List> policyNumberList = []; dynamic serviceId; dynamic policyNumberId; @@ -118,8 +119,8 @@ class _ticketsState extends State { client_id!, empCodeString!, 'Active', client_branch_id, mobileNo); final responseInactive = - await apiService.getActiveAndInactivePolicyDetails(client_id!, - empCodeString!, 'Inactive', client_branch_id, mobileNo); + await apiService.getActiveAndInactivePolicyDetails(client_id!, + empCodeString!, 'Inactive', client_branch_id, mobileNo); final bool isActiveSuccess = responseActive['status'] == 'success' && responseActive['data'] != null; @@ -163,7 +164,7 @@ class _ticketsState extends State { if (response.containsKey('data')) { setState(() { selfDetails = response['data']; - print('ABBC $selfDetails'); + print(selfDetails); }); } else { // Handle other status messages if needed @@ -272,141 +273,136 @@ class _ticketsState extends State { body: Stack(children: [ SingleChildScrollView( child: Container( - padding: Responsive.isDesktop(context) - ? EdgeInsets.symmetric( - horizontal: MediaQuery.of(context).size.width * - 0.2, // 30% of screen width as horizontal padding - vertical: MediaQuery.of(context).size.height * - 0.05, // 5% of screen height as vertical padding - ) - : EdgeInsets.all(10), - color: Colors.white, - child: Column(children: [ - Card( - elevation: 5, - shape: RoundedRectangleBorder( - borderRadius: + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric( + horizontal: MediaQuery.of(context).size.width * + 0.2, // 30% of screen width as horizontal padding + vertical: MediaQuery.of(context).size.height * + 0.05, // 5% of screen height as vertical padding + ) + : EdgeInsets.all(10), + color: Colors.white, + child: Column(children: [ + Card( + elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15.0), // Set border radius here - ), - child: Container( - decoration: BoxDecoration( - color: Colors.white, // Set background color to white - borderRadius: BorderRadius.circular( - 15.0), // Set border radius for Container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15) - : EdgeInsets.only( + ), + child: Container( + decoration: BoxDecoration( + color: Colors.white, // Set background color to white + borderRadius: BorderRadius.circular( + 15.0), // Set border radius for Container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15) + : EdgeInsets.only( top: 10, bottom: 10, left: 10, right: 10), // Add padding to the container - child: Row( - children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - color: Color( - 0xFFFFFCE5), // Set background color for the container - borderRadius: BorderRadius.circular( - 10), // Set border radius for the container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( + child: Row( + children: [ + Expanded( + flex: 12, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + color: Color( + 0xFFFFFCE5), // Set background color for the container + borderRadius: BorderRadius.circular( + 10), // Set border radius for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( top: 20, bottom: 20, left: 0, right: 0) - : EdgeInsets.only( + : EdgeInsets.only( top: 10, bottom: 10, left: 10, right: 10), - child: Column( - crossAxisAlignment: + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.pushNamed( - context, 'help'); - }, - child: Icon( - Icons - .chevron_left, // Replace with your desired icon - color: Color(0xFF000000), - size: 30, + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pushNamed( + context, 'help'); + }, + child: Icon( + Icons + .chevron_left, // Replace with your desired icon + color: Color(0xFF000000), + size: 30, + ), + ), ), - ), - ), - Expanded( - flex: 11, - child: Row( - mainAxisAlignment: + Expanded( + flex: 11, + child: Row( + mainAxisAlignment: Responsive.isDesktop(context) ? MainAxisAlignment.center : MainAxisAlignment.start, - children: [ - Text( - 'Raise a Ticket', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: + children: [ + Text( + 'Raise a Ticket', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop( - context) + context) ? 20 : 16, - fontWeight: FontWeight.w600, - color: Color(0xFF000000), - ), - ) - ], - ), - ) + fontWeight: FontWeight.w600, + color: Color(0xFF000000), + ), + ) + ], + ), + ) + ], + ), // Space between rows + // Add more rows as needed ], - ), // Space between rows - // Add more rows as needed - ], - ), - ), - SizedBox(height: 15), - Container( - child: Column( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, + ), + ), + SizedBox(height: 15), + Container( + child: Column( children: [ - Container( - width: double.infinity, - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: + crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Form( - key: formKey, - child: Column( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment - .start, + children: [ + Form( + key: formKey, + child: Column( children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -512,62 +508,30 @@ class _ticketsState extends State { ), ), ), - ], - ), - ), - ], - ), - SizedBox(height: 15), - Row( - children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment.centerRight, - child: ElevatedButton( - onPressed: () { - sendFormDataToApi(); - }, - child: Text( - 'Send', - style: GoogleFonts.poppins( - color: Colors.white), - ), - style: ElevatedButton.styleFrom( - backgroundColor: - Color(0xFFE26728), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular( - 5), - ), - ), ), - ), + ], ), ], ), - ], - ), - ), - ], - ))), - ], + ), + ], + ))), + ], + ), + ), ), - ), - ), - SizedBox(height: Responsive.isDesktop(context) ? 40 : 60), - ]), - )), + SizedBox(height: Responsive.isDesktop(context) ? 40 : 60), + ]), + )), if (isLoading) Container( color: Color(0x98FFFCE5), // Semi-transparent background child: Center( child: // Your GIF loader widget - Image.asset( - height: 60, - width: 60, - 'assets/nhance-loader.gif'), // Adjust path to your GIF loader + Image.asset( + height: 60, + width: 60, + 'assets/nhance-loader.gif'), // Adjust path to your GIF loader ), ), if (Responsive.isDesktop(context)) @@ -593,36 +557,36 @@ class _ticketsState extends State { bottomNavigationBar: Responsive.isDesktop(context) ? null : CustomBottomNavigationBar( - onTabChanged: (index) { - // repositionBotman(); - if (index == 0) { - Navigator.pushNamed(context, 'home'); - } else if (index == 1) { - Navigator.pushNamed(context, 'claims'); - } else if (index == 2) { - Navigator.pushNamed(context, 'profile'); - } else if (index == 3) { - Navigator.pushNamed(context, 'help'); - // Navigator.pushNamed(context, 'help'); - } else if (index == 4) { - Navigator.pushNamed(context, 'wellness'); - } - }, - icons: [ - Icons.home_outlined, - Icons.sticky_note_2_outlined, - Icons.person_outline_outlined, - Icons.headset_mic_outlined, - Icons.health_and_safety_outlined, - ], - labels: [ - "Home", - "Claim", - "Profile", - "Help", - "Wellness", - ], // Initial index of the bottom navigation bar - ), + onTabChanged: (index) { + // repositionBotman(); + if (index == 0) { + Navigator.pushNamed(context, 'home'); + } else if (index == 1) { + Navigator.pushNamed(context, 'claims'); + } else if (index == 2) { + Navigator.pushNamed(context, 'profile'); + } else if (index == 3) { + Navigator.pushNamed(context, 'help'); + // Navigator.pushNamed(context, 'help'); + } else if (index == 4) { + Navigator.pushNamed(context, 'wellness'); + } + }, + icons: [ + Icons.home_outlined, + Icons.sticky_note_2_outlined, + Icons.person_outline_outlined, + Icons.headset_mic_outlined, + Icons.health_and_safety_outlined, + ], + labels: [ + "Home", + "Claim", + "Profile", + "Help", + "Wellness", + ], // Initial index of the bottom navigation bar + ), ); } @@ -656,14 +620,14 @@ class _ticketsState extends State { } Widget buildDropdownField( - String label, - void Function(T?) onChanged, - bool readOnly, - List> itemsList, - String displayField, - T? selectedValue, { - String valueKey = 'id', - }) { + String label, + void Function(T?) onChanged, + bool readOnly, + List> itemsList, + String displayField, + T? selectedValue, { + String valueKey = 'id', + }) { return DropdownButtonFormField( value: selectedValue, decoration: InputDecoration(labelText: label), @@ -671,7 +635,7 @@ class _ticketsState extends State { return DropdownMenuItem( value: item[valueKey] as T, // ✅ cast to generic type child: - Text(item[displayField].toString()), // always display as String + Text(item[displayField].toString()), // always display as String ); }).toList(), onChanged: readOnly ? null : onChanged, @@ -683,4 +647,4 @@ class _ticketsState extends State { }, ); } -} +} \ No newline at end of file diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index d4f08de..b723da8 100755 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -27,7 +27,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin")) FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) - LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin")) + FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))