diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 03aee0a7..55a39d0a 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -159,11 +159,11 @@ class BaseAppClient { body!.removeWhere((key, value) => key == null || value == null); - if (AppGlobal.isNetworkDebugEnabled) { + // if (AppGlobal.isNetworkDebugEnabled) { print("URL : $url"); final jsonBody = json.encode(body); print(jsonBody); - } + // } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 07d8bf95..021d4bf2 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -53,8 +53,8 @@ class _BookSuccessState extends State { // AuthenticatedUser authUser; late ProjectViewModel projectViewModel; - String selectedPaymentMethod = ""; - String selectedInstallments = ""; + String? selectedPaymentMethod = ""; + String? selectedInstallments = ""; String? tamaraPaymentStatus; String? tamaraOrderID; @@ -600,7 +600,7 @@ class _BookSuccessState extends State { }); } - openPayment(List paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { + openPayment(List paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); selectedPaymentMethod = paymentMethod[0]; selectedInstallments = paymentMethod[1]; @@ -610,7 +610,7 @@ class _BookSuccessState extends State { Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), appo.projectID.toString(), authenticatedUser.emailAddress!, - paymentMethod[0], + paymentMethod[0]!, authenticatedUser.patientType, authenticatedUser.firstName!, authenticatedUser.patientID, @@ -682,10 +682,10 @@ class _BookSuccessState extends State { service.getTamaraPaymentStatus(orderID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res["status"].toString().toLowerCase() == "success") { - updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID!, int.parse(selectedInstallments), appo); + updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID!, int.parse(selectedInstallments!), appo); } else { updateTamaraRequestStatus( - "Failed", "00", Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), tamaraOrderID != null ? tamaraOrderID! : "", int.parse(selectedInstallments), appo); + "Failed", "00", Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), tamaraOrderID != null ? tamaraOrderID! : "", int.parse(selectedInstallments!), appo); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); @@ -998,7 +998,7 @@ class _BookSuccessState extends State { appointment.doctorTitle = "Dr. "; appointment.doctorNameObj = widget.patientShareResponse.doctorNameObj; appointment.doctorImageURL = widget.patientShareResponse.doctorImageURL; - appointment.doctorSpeciality = widget.patientShareResponse.doctorSpeciality as List; + appointment.doctorSpeciality = (widget.patientShareResponse.doctorSpeciality != null) ? widget.patientShareResponse.doctorSpeciality as List : [""]; appointment.projectName = widget.patientShareResponse.projectName; appointment.projectID = widget.patientShareResponse.projectID; appointment.appointmentDate = widget.patientShareResponse.appointmentDate; diff --git a/lib/pages/BookAppointment/book_reminder_page.dart b/lib/pages/BookAppointment/book_reminder_page.dart index c0a0aa90..49986844 100644 --- a/lib/pages/BookAppointment/book_reminder_page.dart +++ b/lib/pages/BookAppointment/book_reminder_page.dart @@ -188,6 +188,7 @@ class _BookReminderPageState extends State { backgroundColor: CustomColors.green, elevation: 0, onPressed: () async { + print(widget.patientShareResponse); print(widget.patientShareResponse.appointmentNo); showReminderDialog( context, @@ -200,6 +201,7 @@ class _BookReminderPageState extends State { AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); navigateToBookSuccess(context); }, + title: "" ); projectViewModel.analytics.appointment.appointment_reminder(true); }, diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index f64c44f3..0574ce41 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -92,7 +92,7 @@ class DoctorView extends StatelessWidget { // DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctor.date)), Text( - doctor.date != null ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctor.date )) : DateTime.now().toString(), + doctor.date != null ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctor.date )) : DateUtil.getDayMonthYearDateFormatted(DateTime.now()).toString(), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ) , @@ -140,7 +140,7 @@ class DoctorView extends StatelessWidget { itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), + full: Icon(Icons.star, ), half: Icon(Icons.star_half), empty: Icon(Icons.star), ), diff --git a/lib/pages/BookAppointment/widgets/reminder_dialog.dart b/lib/pages/BookAppointment/widgets/reminder_dialog.dart index eab072a0..fe9797e6 100644 --- a/lib/pages/BookAppointment/widgets/reminder_dialog.dart +++ b/lib/pages/BookAppointment/widgets/reminder_dialog.dart @@ -24,19 +24,20 @@ showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, S if (Platform.isAndroid) { if (await PermissionService.isCalendarPermissionEnabled()) { _showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, - onSuccess: onSuccess, title: title!, description: description!, onMultiDateSuccess: onMultiDateSuccess!); + onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int){}); } else { Utils.showPermissionConsentDialog(context, TranslationBase.of(context).calendarPermission, () async { if (await Permission.calendar.request().isGranted) { _showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, - onSuccess: onSuccess, title: title!, description: description!, onMultiDateSuccess: onMultiDateSuccess!); + onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int){}); } }); } } else { if (await Permission.calendar.request().isGranted) { + print(await Permission.calendar.request().isGranted); _showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, - onSuccess: onSuccess, title: title!, description: description!, onMultiDateSuccess: onMultiDateSuccess!); + onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int){}); } } } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 382a9691..10c32014 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1296,8 +1296,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { patientShare: widget.patientShareResponse.patientShareWithTax))) .then((value) { print(value); - selectedPaymentMethod = value[0]; - selectedInstallments = value[1]; + selectedPaymentMethod = value[0] ?? ""; + selectedInstallments = value[1] ?? ""; getPatientAppointmentHistory(); if (value != null) { diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index 9859e248..926eb1a4 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -526,7 +526,7 @@ class _PaymentMethodState extends State { selectedInstallmentPlan = tamaraInstallmentDetails!.supportedInstalments![0].instalments.toString(); GifLoaderDialogUtils.hideDialog(context); setState(() {}); - } as FutureOr Function(Map value)).catchError((err) { + }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); }); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index ee50866f..15e9e0a0 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1577,9 +1577,10 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getTamaraPaymentDetails(BuildContext context) async { + Future> getTamaraPaymentDetails(BuildContext context) async { dynamic localRes; await baseAppClient.get(GET_TAMARA_PLAN, isExternal: true, onSuccess: (response, statusCode) async { + print(response); localRes = response[0]; }, onFailure: (String error, int statusCode) { throw error; diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 5ced91ba..8ae6aa3b 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -107,7 +107,7 @@ class DoctorHeader extends StatelessWidget { if (headerModel.nationalityFlagURL != null) Padding( padding: const EdgeInsets.only(top: 8.0), - child: headerModel.nationalityFlagURL.isNotEmpty && headerModel.nationalityFlagURL != null ? Image.network(headerModel.nationalityFlagURL, height: 20) : SizedBox(), + child: headerModel.nationalityFlagURL.isNotEmpty && headerModel.nationalityFlagURL != null && headerModel.nationalityFlagURL != 'null'? Image.network(headerModel.nationalityFlagURL, height: 20) : SizedBox(), ), ], ) diff --git a/lib/widgets/nfc/nfc_reader_sheet.dart b/lib/widgets/nfc/nfc_reader_sheet.dart index a52874e9..f8d6282e 100644 --- a/lib/widgets/nfc/nfc_reader_sheet.dart +++ b/lib/widgets/nfc/nfc_reader_sheet.dart @@ -34,7 +34,7 @@ class NfcLayout extends StatefulWidget { class _NfcLayoutState extends State { bool _reading = false; - late Widget mainWidget; + Widget? mainWidget; late String nfcId; @override