diff --git a/lib/main.dart b/lib/main.dart index 82a98a4..f9ce970 100755 --- a/lib/main.dart +++ b/lib/main.dart @@ -131,10 +131,13 @@ class MyApp extends StatelessWidget { 'profile': (context) => profile(), 'wellness': (context) => wellness(), 'planclaimsform': (context) => planclaimsform(), - 'claimtracklist': (context) => claimtracklist(), + 'claimtracklist': (context) => claimtracklist( + ticketID: "", + ), 'privacypolicy': (context) => privacypolicy(), 'termsofuse': (context) => termsofuse(), - 'generalExclusionsDeductibles': (context) => generalExclusionsDeductibles(), + 'generalExclusionsDeductibles': (context) => + generalExclusionsDeductibles(), // 'home': (context) => kIsWeb ? Home() : BotmanScaffold(currentRoute: 'home', child: Home()), // 'policies': (context) => kIsWeb ? policies() : BotmanScaffold(currentRoute: 'policies', child: policies()), // 'claims': (context) => kIsWeb ? claims() : BotmanScaffold(currentRoute: 'claims', child: claims()), @@ -215,4 +218,3 @@ class SplashScreen extends StatelessWidget { // ); // } // } - diff --git a/lib/pages/postEnrollment/claimtracklist.dart b/lib/pages/postEnrollment/claimtracklist.dart index 6b53c6d..7983db5 100755 --- a/lib/pages/postEnrollment/claimtracklist.dart +++ b/lib/pages/postEnrollment/claimtracklist.dart @@ -15,7 +15,8 @@ import '../../customAppBar/tabs.dart'; import '../../customAppBar/toastHelper.dart'; class claimtracklist extends StatefulWidget { - const claimtracklist({Key? key}) : super(key: key); + final String ticketID; + const claimtracklist({Key? key, required this.ticketID}) : super(key: key); @override State createState() => _claimtracklistformState(); @@ -23,6 +24,7 @@ class claimtracklist extends StatefulWidget { class _claimtracklistformState extends State { late ApiService apiService; + late String ticketID; dynamic _token; bool isLoading = false; dynamic empCodeString; @@ -32,9 +34,12 @@ class _claimtracklistformState extends State { dynamic policyDataIsEmpty = 1; dynamic policyHeading; dynamic policyName; + dynamic policyType; + dynamic policyTickID; dynamic policyDate; dynamic policyStatus; dynamic policySubject; + dynamic policyMessage; dynamic policyNo; dynamic hospitalName; dynamic admitDate; @@ -47,9 +52,13 @@ class _claimtracklistformState extends State { List> employeeDetails = []; dynamic argumentsData; dynamic decodedToken; - dynamic claimTrackMsgList; + // dynamic claimTrackMsgList; + List claimTrackMsgList = []; + + dynamic claimTrackMasterList; + dynamic claimTrackList; dynamic empName; - dynamic ticketID; + // dynamic ticketID; late TextEditingController messageController; final Map statusColors = { 'Open': Colors.green, @@ -65,8 +74,11 @@ class _claimtracklistformState extends State { @override void initState() { super.initState(); + ticketID = widget.ticketID; + print('ticketID: $ticketID'); apiService = ApiService(context); // Initialize ApiService here _loadToken(); + messageController = TextEditingController(); } @@ -77,33 +89,15 @@ class _claimtracklistformState extends State { } @override - void didChangeDependencies() { - super.didChangeDependencies(); - dynamic arguments = ModalRoute.of(context)!.settings.arguments; - if (arguments != null && arguments is Map) { - argumentsData = arguments; - print('argumentsData'); - print(argumentsData); - ticketID = argumentsData['id']; - claimTrackMsgList = argumentsData['message_list']; - departmentID = argumentsData['department_id']; - policyName = argumentsData['policy_name']; - policyStatus = argumentsData['status_value']; - policyNo = argumentsData['policy_no']; - policySubject = argumentsData['subject']; - policyDate = formatDateWithTime(argumentsData['date']); - claimAmount = argumentsData['claim_amount']; - member = argumentsData['member_name']; - if (departmentID == '3') { - accidentDate = argumentsData['accident_date']; - } else if (departmentID == '4') { - hospitalName = argumentsData['hospital_name']; - admitDate = argumentsData['admit_date']; - dischargeDate = argumentsData['discharge_date']; - } - print(claimTrackMsgList); - } - } + // void didChangeDependencies() { + // super.didChangeDependencies(); + // print('ticket'); + // dynamic arguments = ModalRoute.of(context)!.settings.arguments; + // if (arguments != null && arguments is int) { + // ticketID = arguments; + // print('ticketID: $ticketID'); + // } + // } Future _loadToken() async { print('_loadToken'); @@ -118,10 +112,12 @@ class _claimtracklistformState extends State { print(decodedToken); empName = decodedToken['name']; empCodeString = prefs.getString('empCode'); - print(empCodeString); // Check if emp_code is correct + print('empCodeString - $empCodeString'); // Check if emp_code is correct empPrimaryId = prefs.getString('empPrimaryId'); + print('empPrimaryId- $empPrimaryId'); client_id = prefs.getString('client_id'); - print(client_id); + print('client_id- $client_id'); + getTicketConvoList(); } else { // Token is empty or null, handle accordingly (e.g., navigate to login screen) // For now, let's navigate to the login screen @@ -135,18 +131,20 @@ class _claimtracklistformState extends State { isLoading = true; }); try { + print("FORMDATA - $formData"); formData = formData.map((key, value) => MapEntry(key, value.toString())); - + print("FORMDATA1 - $formData"); final response = await apiService.sendClaimsMessageToApi(formData); - - if (response['success'] == 1) { + print("REs - $response"); + if (response['status'] == 'success') { messageController.clear(); - ToastHelper.showSuccessToast(context, 'Saved Successfully...'); + // ToastHelper.showSuccessToast(context, 'Saved Successfully...'); messageController.clear(); setState(() { isLoading = false; }); - Navigator.pushNamed(context, 'claims', arguments: 0); + // Navigator.pushNamed(context, 'claims', arguments: 0); + getTicketConvoList(); print('Form data sent successfully.'); } else { print('Failed to submit form data: ${response['status']}'); @@ -164,6 +162,72 @@ class _claimtracklistformState extends State { } } + Future getTicketConvoList() async { + setState(() { + isLoading = true; + }); + + try { + print('check getTicketList 1'); + final response = await apiService.getTicketConverList(ticketID); + print('check getTicketList 2'); + setState(() { + isLoading = false; + }); + // if (response['success'] == true && response['data'] is List) { + setState(() { + claimTrackList = response['data']; + print("TCtt1 - $claimTrackList"); + claimTrackMasterList = response['data']['master']; + print("TCtt2 - $claimTrackMasterList"); + claimTrackMsgList = response['data']['notes']; + print("TCtt3 - $claimTrackMsgList"); + + if (claimTrackMasterList != []) { + print("ClaimLST - "); + print(claimTrackMasterList[0]['thz_id']); + policyTickID = claimTrackMasterList[0]['thz_id']; + policyName = claimTrackMasterList[0]['policy_no']; + policyType = claimTrackMasterList[0]['ticket_type']; + policyStatus = claimTrackMasterList[0]['status']; + member = claimTrackMasterList[0]['assignee_name']; + policySubject = claimTrackMasterList[0]['subject']; + policyMessage = claimTrackMasterList[0]['message']; + // print("ClaimLST - ${claimTrackMasterList['thz_id'].toString()}"); + } + // reversedTicketList = List>.from(ticketList); + // print("TC2 - $ticketList"); + // ticketList = reversedTicketList.reversed.toList(); + // print("TC3 - $ticketList"); + }); + // } + // else if (response['status'] == "error" && + // response['message'] == "No tickets found") { + // setState(() { + // ticketList = []; + // trackClaimsList = []; + // trackClaimsClosedList = []; + // }); + // ToastHelper.showErrorToast(context, 'No tickets found'); + // } else { + // setState(() { + // isLoading = false; + // }); + // ToastHelper.showErrorToast(context, 'Something went wrong'); + // print('API request failed with status: ${response['status']}'); + // } + } catch (e) { + // ToastHelper.showErrorToast(context, 'Failed to load data'); + print('Error in getTicketList: $e'); + } finally { + if (mounted) { + setState(() { + isLoading = false; + }); + } + } + } + @override Widget build(BuildContext context) { return Scaffold( @@ -289,210 +353,314 @@ class _claimtracklistformState extends State { : buildMobileLayout(context) ], ), // Space between rows - // Add more rows as needed ], ), ), SizedBox(height: 15), + // 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: 10, + // right: 10) + // : EdgeInsets.only( + // top: 10, + // bottom: 10, + // left: 10, + // right: 10), + // child: Column( + // children: [ + // Row( + // children: [ + // buildExpandedColumn(context, + // 'Subject', policySubject), + // ], + // ), + // + // SizedBox( + // height: 15, + // ), + // Row( + // children: [ + // buildExpandedColumn(context, + // 'Message', policyMessage), + // ], + // ), + // // Add more rows as needed + // ], + // ), + // ), + // SizedBox(height: 15), Container( + decoration: BoxDecoration( + // color: Color( + // 0xFFFFFCE5), // Set background color for the container + borderRadius: BorderRadius.circular( + 10), // Set border radius for the container + ), child: SingleChildScrollView( - child: Column(children: [ - ...claimTrackMsgList - .map((message) { - bool isUserMessage = - message['staff_name'] == null; - String messageContent = - message['message']; - String messageDate = message['date']; - dynamic messagername; - if (isUserMessage) { - messagername = empName; - } else { - messagername = message['staff_name']; - } - - return Padding( - padding: const EdgeInsets.symmetric( - vertical: 4.0), - child: Align( - alignment: isUserMessage - ? Alignment.centerLeft - : Alignment.centerLeft, - child: Container( - constraints: - BoxConstraints(maxWidth: 800), - padding: EdgeInsets.all(10), - decoration: BoxDecoration( - color: isUserMessage - ? Colors.blue[100] - : Colors.green[100], - borderRadius: - BorderRadius.circular(10), - ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - messageContent, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 14 - : 12, - fontWeight: - FontWeight.w400, - color: Color(0xFF000000), - ), - ), - SizedBox(height: 5), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Row( - children: [ - Icon( - Icons.person, - color: Color( - 0xFFE26728), - size: 15, - ), - SizedBox(width: 5), - Text( - messagername, - style: GoogleFonts - .poppins( - fontSize: Responsive - .isDesktop( - context) - ? 16 - : 14, - fontWeight: - FontWeight - .w500, - color: Color( - 0xFF000000), - ), - ), - ], - ), - Text( - formatDateWithTime( - messageDate), - style: - GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 12 - : 10, - fontWeight: - FontWeight.w400, - color: - Color(0xFF636363), - ), - ), - ], - ), - ], + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 4.0, horizontal: 4.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + Text( + "Conversation", + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop( + context) + ? 18 + : 14, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), ), ), - ), - ); - }).toList(), - Padding( - padding: const EdgeInsets.symmetric( - vertical: 8.0), - child: Row( - children: [ - Expanded( - flex: Responsive.isDesktop( - context) - ? 10 - : 9, - child: TextFormField( - controller: messageController, - onChanged: (value) => null, - decoration: InputDecoration( - border: - OutlineInputBorder(), - hintText: 'Message', - labelText: 'Message', - contentPadding: - EdgeInsets.symmetric( - vertical: 10, - horizontal: 15), - ), - validator: (value) { - if (value == null || - value.isEmpty) { - return 'Message is required'; - } - return null; - }, - ), - ), - Expanded( - flex: Responsive.isDesktop( - context) - ? 2 - : 3, - child: Container( - alignment: - Alignment.centerRight, - child: ElevatedButton( - onPressed: () { - // Check if any of the fields are empty - if (messageController - .text.isEmpty) { - ToastHelper - .showWarningToast( - context, - 'All fields are required'); - } else { - // Create a map to hold the form data - Map - formData = { - 'ticket_id': ticketID, - 'replier': 'user', - 'message': - messageController - .text, - // Add more form fields as needed - }; + ...claimTrackMsgList + .map((message) { + bool isUserMessage; + // bool isUserMessage = + // message['notes_by'] == null; + String messageContent = + message['notes']; + String messageDate = + message['created_at']; + dynamic messagername; + messagername = + message['notes_by']; + // if (isUserMessage) { + // messagername = empName; + // } else { + // messagername = message['staff_name']; + // } - // Call the function to send form data to API - sendClaimsMessage( - formData); - } - }, - child: Text( - 'Reply', - style: - GoogleFonts.poppins( - color: - Colors.white), + if (messagername == "Staff") { + isUserMessage = true; + } else { + isUserMessage = false; + } + + return Padding( + padding: + const EdgeInsets.symmetric( + vertical: 4.0, + horizontal: 4.0), + child: Align( + alignment: isUserMessage + ? Alignment.centerLeft + : Alignment.centerLeft, + child: Container( + constraints: BoxConstraints( + maxWidth: 800), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: isUserMessage + ? Colors.blue[100] + : Colors.green[100], + borderRadius: + BorderRadius.circular( + 10), ), - style: ElevatedButton - .styleFrom( - backgroundColor: - Color(0xFFE26728), - shape: - RoundedRectangleBorder( - borderRadius: - BorderRadius - .circular(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + messageContent, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 14 + : 12, + fontWeight: + FontWeight.w400, + color: Color( + 0xFF000000), + ), + ), + SizedBox(height: 5), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Row( + children: [ + Icon( + Icons.person, + color: Color( + 0xFFE26728), + size: 15, + ), + SizedBox( + width: 5), + Text( + messagername, + style: GoogleFonts + .poppins( + fontSize: + Responsive.isDesktop(context) + ? 16 + : 14, + fontWeight: + FontWeight + .w500, + color: Color( + 0xFF000000), + ), + ), + ], + ), + Text( + // formatDateWithTime( + // messageDate), + + formatDateWithTime( + messageDate), + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 12 + : 10, + fontWeight: + FontWeight + .w400, + color: Color( + 0xFF636363), + ), + ), + ], + ), + // Divider(), + ], + ), + ), + ), + ); + }).toList(), + Padding( + padding: + const EdgeInsets.symmetric( + vertical: 8.0), + child: Row( + children: [ + Expanded( + flex: + Responsive.isDesktop( + context) + ? 10 + : 9, + child: TextFormField( + controller: + messageController, + onChanged: (value) => + null, + decoration: + InputDecoration( + border: + OutlineInputBorder(), + hintText: 'Message', + labelText: 'Message', + contentPadding: + EdgeInsets + .symmetric( + vertical: + 10, + horizontal: + 15), + ), + validator: (value) { + if (value == null || + value.isEmpty) { + return 'Message is required'; + } + return null; + }, ), ), - ), - ), - ), - ], - )), - ]), + Expanded( + flex: + Responsive.isDesktop( + context) + ? 2 + : 3, + child: Container( + alignment: Alignment + .centerRight, + child: ElevatedButton( + onPressed: () { + // Check if any of the fields are empty + if (messageController + .text.isEmpty) { + ToastHelper + .showWarningToast( + context, + 'All fields are required'); + } else { + // Create a map to hold the form data + Map + formData = { + 'thz_id': + ticketID, + 'notes': + messageController + .text, + 'notes_by': + 'User', + // Add more form fields as needed + }; + + // Call the function to send form data to API + sendClaimsMessage( + formData); + } + }, + child: Text( + 'Reply', + style: GoogleFonts + .poppins( + color: Colors + .white), + ), + style: ElevatedButton + .styleFrom( + backgroundColor: + Color( + 0xFFE26728), + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius + .circular( + 5), + ), + ), + ), + ), + ), + ], + )), + ]), + ), ), ), ], @@ -570,14 +738,11 @@ class _claimtracklistformState extends State { } String formatDateWithTime(String timestamp) { - // Convert the timestamp string to milliseconds - int milliseconds = int.parse(timestamp) * 1000; + // Parse the input string to DateTime + DateTime date = DateFormat("yyyy-MM-dd HH:mm:ss").parse(timestamp); - // Create a DateTime object from milliseconds - DateTime date = DateTime.fromMillisecondsSinceEpoch(milliseconds); - - // Format the DateTime object with date and time - String formattedDate = DateFormat('d MMM, y HH:mm a').format(date); + // Format to your desired output + String formattedDate = DateFormat("dd, MMM yy h:mm a").format(date); return formattedDate; } @@ -588,10 +753,11 @@ class _claimtracklistformState extends State { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - // buildExpandedColumn(context, 'Policy No', policyNo), + buildExpandedColumn(context, 'Policy No', policyTickID), buildExpandedColumn(context, 'Policy Name', policyName), + buildExpandedColumn(context, 'Ticket Type', policyType), buildExpandedColumn(context, 'Status', policyStatus), - buildExpandedColumn(context, 'Subject', policySubject), + buildExpandedColumn(context, 'Assign To', member), ], ), if (departmentID == '4') // Conditional check for policy_type @@ -642,8 +808,16 @@ class _claimtracklistformState extends State { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ + buildExpandedColumn(context, 'Policy No', policyTickID), buildExpandedColumn(context, 'Policy Name', policyName), + ], + ), + SizedBox(height: 20), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ buildExpandedColumn(context, 'Status', policyStatus), + buildExpandedColumn(context, 'Ticket Type', policyType), ], ), SizedBox(height: 20), @@ -651,7 +825,7 @@ class _claimtracklistformState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ buildExpandedColumn(context, 'Subject', policySubject), - buildExpandedColumn(context, 'Member', member), + buildExpandedColumn(context, 'Assigned To', member), ], ), if (departmentID == '4') @@ -699,10 +873,10 @@ class _claimtracklistformState extends State { return Expanded( flex: 3, child: Container( - alignment: Alignment.center, + // alignment: Alignment.center, child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( title, @@ -738,4 +912,43 @@ class _claimtracklistformState extends State { ), ); } + + Widget buildExpandedRow(BuildContext context, String title, String? value) { + return Expanded( + flex: 3, + child: Container( + alignment: Alignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + width: 100, + child: Text( + title, + // textAlign: TextAlign.center, + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop(context) ? 18 : 14, + fontWeight: FontWeight.w400, + color: Color(0xFF000000), + ), + ), + ), + SizedBox(width: Responsive.isDesktop(context) ? 10 : 4), + Flexible( + child: Text( + value ?? '', // Null check for value + // textAlign: TextAlign.center, + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop(context) ? 18 : 16, + fontWeight: FontWeight.w600, + color: Color(0xFF000000), + ), + ), + ), + ], + ), + ), + ); + } } diff --git a/lib/pages/postEnrollment/help.dart b/lib/pages/postEnrollment/help.dart index d278876..78d1e05 100755 --- a/lib/pages/postEnrollment/help.dart +++ b/lib/pages/postEnrollment/help.dart @@ -15,6 +15,7 @@ import '../../customAppBar/customFooter.dart'; import '../../customAppBar/responsive.dart'; import '../../customAppBar/tabs.dart'; import '../../customAppBar/toastHelper.dart'; +import 'claimtracklist.dart'; class help extends StatefulWidget { const help({Key? key}) : super(key: key); @@ -32,6 +33,7 @@ class _helpState extends State { int closedTrackActive = 1; int allClaimsActive = 0; bool _isArgsHandled = false; + int ticketsActive = 1; dynamic _token; dynamic empCodeString; dynamic empPrimaryId; @@ -50,6 +52,8 @@ class _helpState extends State { dynamic empMobileNo; List reversedClaimsList = []; List trackClaimsList = []; + List ticketList = []; + List reversedTicketList = []; List reversedClaimsClosedList = []; List trackClaimsClosedList = []; final Map statusColors = { @@ -191,6 +195,58 @@ class _helpState extends State { // } } + Future getTicketList() async { + if (client_id == null || empCodeString == null) { + return; + } + setState(() { + isLoading = true; + }); + + try { + print('check getTicketList 1'); + final response = await apiService.getTicketListByMobile(empMobileNo!); + print('check getTicketList 2'); + setState(() { + isLoading = false; + }); + // if (response['success'] == true && response['data'] is List) { + setState(() { + ticketList = response['data'].toList(); + print("TC1 - $ticketList"); + reversedTicketList = List>.from(ticketList); + print("TC2 - $ticketList"); + ticketList = reversedTicketList.reversed.toList(); + print("TC3 - $ticketList"); + }); + // } + // else if (response['status'] == "error" && + // response['message'] == "No tickets found") { + // setState(() { + // ticketList = []; + // trackClaimsList = []; + // trackClaimsClosedList = []; + // }); + // ToastHelper.showErrorToast(context, 'No tickets found'); + // } else { + // setState(() { + // isLoading = false; + // }); + // ToastHelper.showErrorToast(context, 'Something went wrong'); + // print('API request failed with status: ${response['status']}'); + // } + } catch (e) { + // ToastHelper.showErrorToast(context, 'Failed to load data'); + print('Error in getTicketList: $e'); + } finally { + if (mounted) { + setState(() { + isLoading = false; + }); + } + } + } + Color getStatusColor(String? policyStatus) { if (policyStatus != null && statusColors.containsKey(policyStatus)) { return statusColors[policyStatus]!; @@ -494,6 +550,7 @@ class _helpState extends State { allClaimsActive = 0; closedTrackActive = 1; tickets = 1; + ticketsActive = 1; }); }, ), @@ -509,6 +566,7 @@ class _helpState extends State { allClaimsActive = 1; closedTrackActive = 0; tickets = 1; + ticketsActive = 1; }); getTrackClaimsList(); }, @@ -525,7 +583,9 @@ class _helpState extends State { allClaimsActive = 1; closedTrackActive = 1; tickets = 0; + ticketsActive = 0; }); + getTicketList(); // getTrackClaimsList(); }, ), @@ -546,6 +606,7 @@ class _helpState extends State { allClaimsActive = 0; closedTrackActive = 1; tickets = 1; + ticketsActive = 1; }); }, ), @@ -560,6 +621,7 @@ class _helpState extends State { allClaimsActive = 1; closedTrackActive = 0; tickets = 1; + ticketsActive = 1; }); getTrackClaimsList(); }, @@ -572,11 +634,16 @@ class _helpState extends State { onTap: () { setState(() { isActive = false; + ticketsActive = 0; allClaimsActive = 1; closedTrackActive = 1; - tickets = 0; + // isActive = false; + // allClaimsActive = 1; + // closedTrackActive = 1; + // tickets = 0; }); - getTrackClaimsList(); + // getTrackClaimsList(); + getTicketList(); }, ), ], @@ -615,7 +682,7 @@ class _helpState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ SvgPicture.string( - SvgService.getSvg('tickets'), + SvgService.getSvg('claims'), width: 60, height: 60, ), @@ -682,7 +749,7 @@ class _helpState extends State { trackClaimsList), // Replace 'yourDataList' with your actual data list ), ), - SizedBox(height: 15), + // SizedBox(height: 15), if (closedTrackActive == 0) if (trackClaimsClosedList == null || trackClaimsClosedList.isEmpty) @@ -783,7 +850,110 @@ class _helpState extends State { trackClaimsClosedList), // Replace 'yourDataList' with your actual data list ), ), + // SizedBox(height: Responsive.isDesktop(context) ? 40 : 70), + + if (ticketsActive == 0) + if (ticketList == null || ticketList.isEmpty) + Card( + elevation: 0, + shape: RoundedRectangleBorder( + side: BorderSide( + color: Color(0xFFD9D9D9), // Set the border color here + width: 1.0, // Set the border width here + ), + borderRadius: BorderRadius.circular( + 8.0), // Set the border radius here + ), + child: Column(children: [ + Container( + decoration: BoxDecoration( + color: Colors + .white, // Set background color for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 10, bottom: 10, left: 10, right: 10) + : EdgeInsets.only( + top: 10, bottom: 10, left: 10, right: 10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 11, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SvgPicture.string( + SvgService.getSvg('tickets'), + width: 60, + height: 60, + ), + SizedBox( + width: + 10), // Adjust space between icon and text + Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + 'No service request yet!', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 18 + : 16, + fontWeight: FontWeight.w600, + color: Color(0xFF000000), + ), + ), + Container( + constraints: BoxConstraints( + maxWidth: Responsive.isDesktop( + context) + ? 800 + : 250), // Adjust the maximum width as needed + child: Text( + 'Please raise a service request, if you have any concerns with your policy.', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 14 + : 12, + fontWeight: FontWeight.w400, + color: Color(0xFF777777), + ), + softWrap: + true, // Ensure text automatically wraps + ), + ), + ], + )) + ], + ), + ), + ], + ), + ), + ]), + ), + if (ticketList != null) + if (ticketsActive == 0) + SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: generateClaimsTicketList( + ticketList), // Replace 'yourDataList' with your actual data list + ), + ), SizedBox(height: Responsive.isDesktop(context) ? 40 : 70), + + // generateClaimsTicketList ]), )), if (isLoading) @@ -928,7 +1098,7 @@ class _helpState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SvgPicture.string( - SvgService.getSvg('tickets'), + SvgService.getSvg('claims'), width: 40, height: 40, ), @@ -1284,6 +1454,217 @@ class _helpState extends State { ]; } + List generateClaimsTicketList(List data) { + return [ + ListView.builder( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemCount: data.length, + itemBuilder: (BuildContext context, int index) { + var item = data[index]; + + // String claimsName = item['user_name']; + String claimsSubject = item['subject'] ?? ''; + String claimsDate = item['created_at'] ?? ''; + String claimStatus = item['status'] ?? ''; + String claimsDepartmentName = item['ticket_type'] ?? ''; + // String claimsReplies = item['replies']; + // List messageList = item['message_list']; + print("item - $item"); + print('generateTrackList'); + print(claimsSubject); + print(claimsDate); + print(claimStatus); + print(claimsDepartmentName); + + final Map statusColors = { + 'Received': Colors.amber, + 'Rejected': Colors.red, + 'Cancelled': Colors.red, + 'Returned': Colors.deepOrange, + 'Closed': Colors.grey, + 'Approved': Colors.green, + 'Settled': Colors.lightBlueAccent, + 'Under Process': Colors.brown, + }; + + // Determine the color based on the claimStatus + Color statusColor; + if (claimStatus != null) { + statusColor = statusColors[claimStatus!] ?? Color(0xFF979797); + } else { + statusColor = Color(0xFF979797); // Default color if status is null + } + + return GestureDetector( + onTap: () { + print("Navigating with thz_id: ${item['thz_id']}"); + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + claimtracklist(ticketID: item['thz_id']), + ), + ); + + // Navigator.pushNamed( + // context, + // 'claimtracklist', + // arguments: item['thz_id'], + // ); + }, + child: MouseRegion( + cursor: SystemMouseCursors.click, + child: Card( + elevation: 0, + shape: RoundedRectangleBorder( + side: BorderSide( + color: Color(0xFFD9D9D9), // Set the border color here + width: 1.0, // Set the border width here + ), + borderRadius: BorderRadius.circular( + 8.0), // Set the border radius here + ), + child: Column(children: [ + Container( + decoration: BoxDecoration( + color: Colors + .white, // Set background color for the container + ), + padding: EdgeInsets.only( + top: 10, bottom: 10, left: 10, right: 10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 7, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SvgPicture.string( + SvgService.getSvg('tickets'), + width: 40, + height: 40, + ), + SizedBox( + width: + 10), // Adjust space between icon and text + Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + claimsDepartmentName ?? '', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 18 + : 16, + fontWeight: FontWeight.w600, + color: Color(0xFF000000), + ), + ), + SizedBox(height: 5), + Container( + alignment: Alignment + .centerLeft, // Set a fixed width or adjust based on your layout + child: Tooltip( + message: claimsSubject, + child: Text( + claimsSubject.length > 30 + ? '${claimsSubject.substring(0, 30)}...' + : claimsSubject, + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 14 + : 12, + fontWeight: FontWeight.w400, + color: Color(0xFF777777), + ), + ), + )) + ], + )) + ], + ), + ), + Expanded( + flex: 5, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + // Adjust space between icon and text + Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Container( + width: 100, + decoration: BoxDecoration( + color: statusColor, + borderRadius: BorderRadius.circular( + 50), // Border radius set to 50 + ), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Text( + claimStatus, + textAlign: TextAlign.center, + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop( + context) + ? 12 + : 10, + fontWeight: FontWeight.w400, + color: Colors + .white, // Text color against the background + ), + ), + ), + ), + SizedBox(height: 5), + Text( + formatDateWithTime(claimsDate), + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 14 + : 12, + fontWeight: FontWeight.w400, + color: Color(0xFF777777), + ), // Ensure text automatically wraps + ), + ], + )) + ], + ), + ), + ], + ), + ), + ])), + ), + ); + }, + ), + ]; + } + String formatDateWithTime(String timestamp) { // Parse the timestamp string to DateTime DateTime date = DateTime.parse(timestamp); diff --git a/lib/pages/postEnrollment/service/api_service.dart b/lib/pages/postEnrollment/service/api_service.dart index 1c1ff8b..d200fba 100755 --- a/lib/pages/postEnrollment/service/api_service.dart +++ b/lib/pages/postEnrollment/service/api_service.dart @@ -105,6 +105,40 @@ class ApiService { return response; } + Future> getTicketListByMobile(String empMobileNo) async { + print(_token); + if (_token == null) { + await _initializeToken(); + } + + final url2 = + Uri.parse('${Environment.apiUrl}ticketList?mobile=$empMobileNo'); + + final url = Uri.parse('${Environment.apiUrl}ticketList?mobile=1234567890'); + final headers = { + 'Authorization': 'Bearer $_token' ?? '', + }; + final response = await _makeGetRequest(url, headers); + return response; + } + + Future> getTicketConverList(String thz_id) async { + print(_token); + if (_token == null) { + await _initializeToken(); + } + + final url1 = Uri.parse('${Environment.apiUrl}ticketList?mobile=$thz_id'); + + final url = + Uri.parse('${Environment.apiUrl}ticketConversationList?thz_id=$thz_id'); + final headers = { + 'Authorization': 'Bearer $_token' ?? '', + }; + final response = await _makeGetRequest(url, headers); + return response; + } + Future> getWellnessLink() async { print(_token); if (_token == null) { @@ -150,13 +184,16 @@ class ApiService { Future> sendClaimsMessageToApi( Map formData) async { - final url = Uri.parse('${Environment.apiUrlTicket}/messages/create'); + print("sendClaimsMessageToApi"); + final url = Uri.parse('${Environment.apiUrl}ticketConversationSave'); + // final url = Uri.parse('${Environment.apiUrlTicket}/messages/create'); // Convert formData to Map + print("sendClaimsMessageToApi1"); Map stringFormData = formData.map((key, value) => MapEntry(key, value.toString())); final response = await _makePostRequest(url, stringFormData, { 'Content-Type': 'application/x-www-form-urlencoded', - 'Token': Environment.ticketToken, + 'Authorization': 'Bearer $_token' ?? '', }); return response; } diff --git a/lib/pages/postEnrollment/service/svg_service.dart b/lib/pages/postEnrollment/service/svg_service.dart index ead3a43..4c7baf1 100755 --- a/lib/pages/postEnrollment/service/svg_service.dart +++ b/lib/pages/postEnrollment/service/svg_service.dart @@ -146,6 +146,35 @@ class SvgService { '''; + static const String claims = + ''' + + + + + + + + + + + + + + + + + + + + + + + + + +'''; + static const String smartphone = ''' @@ -305,8 +334,6 @@ class SvgService { '''; - // Add more SVG strings here as needed - static String getSvg(String svgName) { switch (svgName) { case 'ECard': @@ -329,6 +356,8 @@ class SvgService { return fileClaims; case 'tickets': return tickets; + case 'claims': + return claims; case 'help': return help; case 'email': @@ -342,4 +371,6 @@ class SvgService { return ''; } } + + // Add more SVG strings here as needed } diff --git a/lib/pages/postEnrollment/tickets.dart b/lib/pages/postEnrollment/tickets.dart index 663c5fe..3bfa994 100644 --- a/lib/pages/postEnrollment/tickets.dart +++ b/lib/pages/postEnrollment/tickets.dart @@ -29,15 +29,15 @@ class _ticketsState extends State { dynamic client_id; List> policyList = []; dynamic policyDataIsEmpty = 1; - int? fromClaimsPage; + int? fromClaimsPage; dynamic decodedToken; List> policyNumberList = []; dynamic serviceId; dynamic policyNumberId; - String? selectedMemberName; + String? selectedMemberName; String? selectedServiceName; String? selectedPolicyNo; - dynamic client_branch_id; + dynamic client_branch_id; dynamic mobileNo; dynamic policyTypeCondition; dynamic client_policy_id; @@ -63,8 +63,6 @@ class _ticketsState extends State { bool isSubjectValid = true; bool isMessageValid = true; - - @override void initState() { super.initState(); @@ -82,9 +80,6 @@ class _ticketsState extends State { super.dispose(); } - - - Future _loadToken() async { print('_loadToken'); final SharedPreferences prefs = await SharedPreferences.getInstance(); @@ -120,15 +115,16 @@ class _ticketsState extends State { try { // Call both APIs final responseActive = await apiService.getActiveAndInactivePolicyDetails( - client_id!, empCodeString!, 'Active', client_branch_id,mobileNo - ); + client_id!, empCodeString!, 'Active', client_branch_id, mobileNo); - final responseInactive = await apiService.getActiveAndInactivePolicyDetails( - client_id!, empCodeString!, 'Inactive', client_branch_id,mobileNo - ); + final responseInactive = + await apiService.getActiveAndInactivePolicyDetails(client_id!, + empCodeString!, 'Inactive', client_branch_id, mobileNo); - final bool isActiveSuccess = responseActive['status'] == 'success' && responseActive['data'] != null; - final bool isInactiveSuccess = responseInactive['status'] == 'success' && responseInactive['data'] != null; + final bool isActiveSuccess = responseActive['status'] == 'success' && + responseActive['data'] != null; + final bool isInactiveSuccess = responseInactive['status'] == 'success' && + responseInactive['data'] != null; final List> activeData = isActiveSuccess ? List>.from(responseActive['data']) @@ -268,7 +264,6 @@ class _ticketsState extends State { } } - @override Widget build(BuildContext context) { return Scaffold( @@ -277,135 +272,141 @@ 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: + 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, - ), - ), + 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), - ), - ) - ], - ), - ) - ], - ), // Space between rows - // Add more rows as needed + fontWeight: FontWeight.w600, + color: Color(0xFF000000), + ), + ) + ], + ), + ) ], - ), - ), - SizedBox(height: 15), - Container( - child: Column( - children: [ - Column( - crossAxisAlignment: + ), // Space between rows + // Add more rows as needed + ], + ), + ), + SizedBox(height: 15), + Container( + child: Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: double.infinity, - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: + children: [ + Container( + width: double.infinity, + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: + crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Form( - key: formKey, - child: Column( + children: [ + Form( + key: formKey, + child: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment + .start, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -511,30 +512,62 @@ 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)) @@ -560,36 +593,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 + ), ); } @@ -622,23 +655,23 @@ 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), items: itemsList.map>((item) { return DropdownMenuItem( value: item[valueKey] as T, // ✅ cast to generic type - child: Text(item[displayField].toString()), // always display as String + child: + Text(item[displayField].toString()), // always display as String ); }).toList(), onChanged: readOnly ? null : onChanged, @@ -650,5 +683,4 @@ class _ticketsState extends State { }, ); } - } diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index b723da8..d4f08de 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")) - FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin")) + LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))