diff --git a/lib/config/config.dart b/lib/config/config.dart index 775d737e..5099d061 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -670,10 +670,10 @@ var GET_DENTAL_INSTRUCTIONS = 'Services/OUTPs.svc/Rest/getProcedureNotification' //PAYFORT var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails"; var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse"; -var payFortEnvironment = FortEnvironment.production; -var applePayMerchantId = "merchant.com.hmgwebservices"; -// var payFortEnvironment = FortEnvironment.test; -// var applePayMerchantId = "merchant.com.hmgwebservices.uat"; +// var payFortEnvironment = FortEnvironment.production; +// var applePayMerchantId = "merchant.com.hmgwebservices"; +var payFortEnvironment = FortEnvironment.test; +var applePayMerchantId = "merchant.com.hmgwebservices.uat"; class AppGlobal { static var context; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 1bb1e75b..8418dd9b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -549,7 +549,7 @@ const Map localizedValues = { "emergency": {"en": "Emergency", "ar": "الطوارئ"}, "erservices": {"en": "Emergency", "ar": "الطوارئ"}, "services2": {"en": "Services", "ar": "خدمات"}, - "cantSeeProfile": {"en": "To view your medical profile, please log in or register now", "ar": "للتصفح ملفك الطبي الرجاء تسجيل الدخول أو التسجيل الآن"}, + "cantSeeProfile": {"en": "To view your medical profile, please log in or register now", "ar": "لتصفح ملفك الطبي الرجاء تسجيل الدخول أو التسجيل الآن"}, "loginRegisterNow": {"en": "Login or Register Now", "ar": "تسجيل الدخول أو التسجيل الآن"}, "HMGPharmacy": {"en": "HMG Pharmacy", "ar": "صيدلية HMG"}, "ecommerceSolution": {"en": "Ecommerce Solution", "ar": "حل التجارة الإلكترونية"}, diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 8c6ad3f6..205909c9 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -41,6 +41,7 @@ class DoctorList { dynamic serviceID; String? setupID; List? speciality; + List? specialityN; dynamic workingHours; dynamic decimalDoctorRate; @@ -87,6 +88,7 @@ class DoctorList { this.serviceID, this.setupID, this.speciality, + this.specialityN, this.workingHours, this.decimalDoctorRate}); @@ -133,6 +135,7 @@ class DoctorList { serviceID = json['ServiceID']; setupID = json['SetupID']; if (json.containsKey('Speciality') && json['Speciality'] != null) speciality = json['Speciality'].cast(); + if (json.containsKey('SpecialityN') && json['SpecialityN'] != null) specialityN = json['SpecialityN'].cast(); workingHours = json['WorkingHours']; decimalDoctorRate = json['DecimalDoctorRate']; } @@ -180,6 +183,7 @@ class DoctorList { data['ServiceID'] = this.serviceID; data['SetupID'] = this.setupID; data['Speciality'] = this.speciality; + data['SpecialityN'] = this.specialityN; data['WorkingHours'] = this.workingHours; data['DecimalDoctorRate'] = this.decimalDoctorRate; return data; diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index d48247f8..cb1183ef 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -669,6 +669,7 @@ class _AnicllaryOrdersState extends State with SingleTic payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { + GifLoaderDialogUtils.hideDialog(context); log("failureResult: ${failureResult.toString()}"); AppToast.showErrorToast(message: failureResult.toString()); }, diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 9c448fd6..61bcb977 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -711,6 +711,7 @@ class _BookSuccessState extends State { payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { + GifLoaderDialogUtils.hideDialog(context); log("failureResult: ${failureResult.toString()}"); AppToast.showErrorToast(message: failureResult.toString()); }, diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index e391ca53..b5680c1c 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -28,14 +28,14 @@ class _SearchState extends State with TickerProviderStateMixin { @override void initState() { - _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type); + _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type, ); super.initState(); } @override Widget build(BuildContext context) { AppGlobal.context = context; - ProjectViewModel projectViewModel = Provider.of(context); + // ProjectViewModel projectViewModel = Provider.of(context); GAnalytics.TREATMENT_TYPE = null; // reset treatment type on start new booking return AppScaffold( @@ -56,13 +56,13 @@ class _SearchState extends State with TickerProviderStateMixin { unselectedLabelColor: Color(0xff575757), labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), labelStyle: TextStyle( - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontFamily: context.read().isArabic ? 'Cairo' : 'Poppins', fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.48, ), unselectedLabelStyle: TextStyle( - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontFamily: context.read().isArabic ? 'Cairo' : 'Poppins', fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.48, @@ -70,13 +70,14 @@ class _SearchState extends State with TickerProviderStateMixin { tabs: [Text(TranslationBase.of(context).clinicName), Text(TranslationBase.of(context).doctorName)], onTap: (idx) { if (idx == 0) - projectViewModel.analytics.appointment.book_appointment_by_clinic(); + context.read().analytics.appointment.book_appointment_by_clinic(); else - projectViewModel.analytics.appointment.book_appointment_by_doctor(); + context.read().analytics.appointment.book_appointment_by_doctor(); }, ), Expanded( child: TabBarView( + physics: NeverScrollableScrollPhysics(), children: [ SearchByClinic(clnicIds: widget.clnicIds), diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 7d74702e..cf2a850a 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -10,7 +10,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -class SearchResults extends StatefulWidget { +class SearchResults extends StatelessWidget { List doctorsList = []; List patientDoctorAppointmentListHospital; bool isLiveCareAppointment; @@ -18,19 +18,16 @@ class SearchResults extends StatefulWidget { bool isDoctorNameSearch; OBGyneProcedureListResponse? obGyneProcedureListResponse; - SearchResults({required this.doctorsList, required this.patientDoctorAppointmentListHospital, this.isObGyneAppointment = false, this.isDoctorNameSearch = false, required this.isLiveCareAppointment, this.obGyneProcedureListResponse}); - - @override - _SearchResultsState createState() => _SearchResultsState(); -} - -class _SearchResultsState extends State { - List tempList = []; - late ProjectViewModel projectViewModel; + SearchResults( + {required this.doctorsList, + required this.patientDoctorAppointmentListHospital, + this.isObGyneAppointment = false, + this.isDoctorNameSearch = false, + required this.isLiveCareAppointment, + this.obGyneProcedureListResponse}); @override Widget build(BuildContext context) { - projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).bookAppo, isShowDecPage: false, @@ -38,44 +35,47 @@ class _SearchResultsState extends State { showNewAppBarTitle: true, showNewAppBar: true, backgroundColor: CustomColors.appBackgroudGrey2Color, - body: widget.patientDoctorAppointmentListHospital.isNotEmpty ? ListView.separated( - physics: BouncingScrollPhysics(), - separatorBuilder: (context, index) { - return Container( - height: 12, - margin: EdgeInsets.only(left: 21, right: 21), - ); - }, - itemBuilder: (context, index) { - return AppExpandableNotifier( - title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0") - ? widget.patientDoctorAppointmentListHospital[index].filterName! + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs! + " " + TranslationBase.of(context).km - : widget.patientDoctorAppointmentListHospital[index].filterName, - isTitleSingleLine: false, - isExpand: widget.patientDoctorAppointmentListHospital.length == 1 ? true : false, - bodyWidget: ListView.separated( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21), - itemBuilder: (context, _index) { - final doctor = widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList![_index]; - return DoctorView( - doctor: doctor, - isLiveCareAppointment: widget.isLiveCareAppointment, - isObGyneAppointment: widget.isObGyneAppointment, - isDoctorNameSearch: widget.isDoctorNameSearch, - obGyneProcedureListResponse: widget.obGyneProcedureListResponse, - isShowDate: false, - onTap: () { - projectViewModel.analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor); - }); - }, - separatorBuilder: (context, index) => SizedBox(height: 14), - itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList!.length), - ); - }, - itemCount: widget.patientDoctorAppointmentListHospital.length, - ) : getNoDataWidget(context), + body: patientDoctorAppointmentListHospital.isNotEmpty + ? ListView.separated( + addAutomaticKeepAlives: true, + physics: BouncingScrollPhysics(), + separatorBuilder: (context, index) { + return Container( + height: 12, + margin: EdgeInsets.only(left: 21, right: 21), + ); + }, + itemBuilder: (context, index) { + return AppExpandableNotifier( + title: (patientDoctorAppointmentListHospital[index].distanceInKMs != "0") + ? patientDoctorAppointmentListHospital[index].filterName! + " - " + patientDoctorAppointmentListHospital[index].distanceInKMs! + " " + TranslationBase.of(context).km + : patientDoctorAppointmentListHospital[index].filterName, + isTitleSingleLine: false, + isExpand: patientDoctorAppointmentListHospital.length == 1 ? true : false, + bodyWidget: ListView.separated( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21), + itemBuilder: (context, _index) { + final doctor = patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList![_index]; + return DoctorView( + doctor: doctor, + isLiveCareAppointment: isLiveCareAppointment, + isObGyneAppointment: isObGyneAppointment, + isDoctorNameSearch: isDoctorNameSearch, + obGyneProcedureListResponse: obGyneProcedureListResponse, + isShowDate: false, + onTap: () { + context.read().analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor); + }); + }, + separatorBuilder: (context, index) => SizedBox(height: 14), + itemCount: patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList!.length), + ); + }, + itemCount: patientDoctorAppointmentListHospital.length, + ) + : getNoDataWidget(context), ); } } diff --git a/lib/pages/BookAppointment/components/LiveCareBookAppointment.dart b/lib/pages/BookAppointment/components/LiveCareBookAppointment.dart index 7901d7b6..3a3f8270 100644 --- a/lib/pages/BookAppointment/components/LiveCareBookAppointment.dart +++ b/lib/pages/BookAppointment/components/LiveCareBookAppointment.dart @@ -69,7 +69,7 @@ class _LiveCareBookAppointmentState extends State { width: 150.0), ), Container( - margin: EdgeInsets.only(left: 10.0, right: 10.0), + margin: EdgeInsets.only(left: 10.0, right: 8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 6fb76141..747dcb92 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -60,7 +60,6 @@ class _SearchByClinicState extends State { final GlobalKey clinicDropdownKey = GlobalKey(); final GlobalKey projectDropdownKey = GlobalKey(); TextEditingController ageController = new TextEditingController(); - late ProjectViewModel projectViewModel; String radioValue = ""; @@ -70,15 +69,14 @@ class _SearchByClinicState extends State { void initState() { locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList()); + checkPVM(); super.initState(); } - @override - Widget build(BuildContext context) { - projectViewModel = Provider.of(context); - if (projectViewModel.isLogin) { + void checkPVM(){ + if (context.read().isLogin) { if (radioValue == null) { - if (projectViewModel.user.gender == 1) { + if (context.read().user.gender == 1) { radioValue = TranslationBase.of(context).male; } else { radioValue = TranslationBase.of(context).female; @@ -88,16 +86,20 @@ class _SearchByClinicState extends State { radioValue = TranslationBase.of(context).female; } if (ageController.text.isEmpty) { - ageController.text = projectViewModel.isLogin ? projectViewModel.user!.age.toString() : ""; + ageController.text = context.read().isLogin ? context.read().user!.age.toString() : ""; ageController.selection = TextSelection.fromPosition(TextPosition(offset: ageController.text.length)); } + } + + @override + Widget build(BuildContext context) { return Container( child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (projectViewModel.isLogin) + if (context.read().isLogin) Column( children: [ Padding( @@ -246,7 +248,7 @@ class _SearchByClinicState extends State { if (!nearestAppo) getDoctorsList(context); } else {} }); - projectViewModel.analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription); + context.read().analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription); }); }, child: Container( @@ -527,7 +529,7 @@ class _SearchByClinicState extends State { } getProjectsList() { - int languageID = projectViewModel.isArabic ? 1 : 2; + int languageID = context.read().isArabic ? 1 : 2; ClinicListService service = new ClinicListService(); List projectsListLocal = []; service @@ -563,8 +565,8 @@ class _SearchByClinicState extends State { searchInfo.clinic = selectedClinic; searchInfo.date = DateTime.now(); - if (projectViewModel.isLogin) { - if (projectViewModel.user.age! > 12) { + if (context.read().isLogin) { + if (context.read().user.age! > 12) { navigateToDentalComplaints(context, searchInfo); } else { callDoctorsSearchAPI(17); @@ -601,7 +603,7 @@ class _SearchByClinicState extends State { } callDoctorsSearchAPI(int clinicID) { - int languageID = projectViewModel.isArabic ? 1 : 2; + int languageID = context.read().isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; List arr = []; diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index be4c8c81..f5c98d87 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -20,7 +20,6 @@ class SearchByDoctor extends StatefulWidget { class _SearchByDoctorState extends State { TextEditingController doctorNameController = new TextEditingController(); late bool _isButtonDisabled; - late ProjectViewModel projectViewModel; @override void initState() { @@ -30,7 +29,6 @@ class _SearchByDoctorState extends State { @override Widget build(BuildContext context) { - projectViewModel = Provider.of(context); return Column( children: [ Expanded( @@ -90,7 +88,7 @@ class _SearchByDoctorState extends State { } getDoctorsList(BuildContext context) { - int languageID = projectViewModel.isArabic ? 1 : 2; + int languageID = context.read().isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; DoctorsListService service = new DoctorsListService(); @@ -150,7 +148,7 @@ class _SearchByDoctorState extends State { _searchDoctor(BuildContext context) { getDoctorsList(context); - projectViewModel.analytics.appointment.book_appointment_doctor_search(query: doctorNameController.text); + context.read().analytics.appointment.book_appointment_doctor_search(query: doctorNameController.text); } navigateToSearchResults(context, List docList, List patientDoctorAppointmentListHospital) { diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index d186c953..3e27f9ba 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -23,7 +23,7 @@ import 'package:provider/provider.dart'; import '../DoctorProfile.dart'; -class DoctorView extends StatelessWidget { +class DoctorView extends StatefulWidget { final DoctorList doctor; bool? isLiveCareAppointment; bool isObGyneAppointment; @@ -36,7 +36,7 @@ class DoctorView extends StatelessWidget { DoctorView( {required this.doctor, - this.isLiveCareAppointment, + this.isLiveCareAppointment, this.isObGyneAppointment = false, this.isDoctorNameSearch = false, this.isContinueDentalPlan = false, @@ -45,23 +45,29 @@ class DoctorView extends StatelessWidget { this.onTap, this.obGyneProcedureListResponse}); + @override + State createState() => _DoctorViewState(); +} + +class _DoctorViewState extends State with AutomaticKeepAliveClientMixin { late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); + super.build(context); return InkWell( onTap: () { - if (isObGyneAppointment) { + if (widget.isObGyneAppointment) { next(context); } else { // if (doctor.clinicID == 17 && isDoctorNameSearch) { // showDentalChiefComplaintsList(context); // } else - if (isShowFlag) { - getDoctorsProfile(context, doctor, isAppo: true, isContinueDentalPlan: isContinueDentalPlan); + if (widget.isShowFlag) { + getDoctorsProfile(context, widget.doctor, isAppo: true, isContinueDentalPlan: widget.isContinueDentalPlan); } - (onTap ?? () {})(); // For log analytics of doctor click from book appointment + (widget.onTap ?? () {})(); // For log analytics of doctor click from book appointment } }, child: Container( @@ -88,23 +94,25 @@ class DoctorView extends StatelessWidget { children: [ Expanded( child: Text( - doctor.name ?? "", + widget.doctor.name ?? "", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), ), - isShowDate ? Text( - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctor.date)), - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), - ) : Container(), + widget.isShowDate + ? Text( + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.doctor.date)), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + ) + : Container(), ], ), - if (doctor.doctorTitle != null) SizedBox(height: 6), + if (widget.doctor.doctorTitle != null) SizedBox(height: 6), Row( mainAxisSize: MainAxisSize.min, children: [ LargeAvatar( - name: doctor.name ?? "", - url: doctor.doctorImageURL!, + name: widget.doctor.name ?? "", + url: widget.doctor.doctorImageURL!, width: 48, height: 48, ), @@ -114,17 +122,25 @@ class DoctorView extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - if (doctor.clinicName != null) MyRichText(TranslationBase.of(context).clinic + ":", doctor.clinicName!, projectViewModel.isArabic), - if (doctor.projectName != null) MyRichText(TranslationBase.of(context).branch, doctor.projectName!, projectViewModel.isArabic), - if (doctor.speciality != null && doctor.speciality!.length > 0) - Text( - this.doctor.speciality![0].trim(), - // getDoctorSpeciality(this.doctor.speciality).trim(), - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), - ), - if (doctor.nearestFreeSlot != null) + if (widget.doctor.clinicName != null) MyRichText(TranslationBase.of(context).clinic + ":", widget.doctor.clinicName!, context.read().isArabic), + if (widget.doctor.projectName != null) MyRichText(TranslationBase.of(context).branch, widget.doctor.projectName!, context.read().isArabic), + if (!projectViewModel.isArabic) + if (widget.doctor.speciality != null && widget.doctor.speciality!.length > 0) + Text( + this.widget.doctor.speciality![0].trim(), + // getDoctorSpeciality(this.doctor.speciality).trim(), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), + ), + if (projectViewModel.isArabic) + if (widget.doctor.specialityN != null && widget.doctor.specialityN!.length > 0) + Text( + this.widget.doctor.specialityN![0].trim(), + // getDoctorSpeciality(this.doctor.speciality).trim(), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), + ), + if (widget.doctor.nearestFreeSlot != null) Text( - getDate(doctor.nearestFreeSlot), + getDate(widget.doctor.nearestFreeSlot), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff359846), letterSpacing: -0.48, height: 18 / 12), ), Row( @@ -140,9 +156,18 @@ class DoctorView extends StatelessWidget { itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star, color: CustomColors.accentColor,), - half: Icon(Icons.star_half, color: CustomColors.accentColor,), - empty: Icon(Icons.star, color: CustomColors.accentColor,), + full: Icon( + Icons.star, + color: CustomColors.accentColor, + ), + half: Icon( + Icons.star_half, + color: CustomColors.accentColor, + ), + empty: Icon( + Icons.star, + color: CustomColors.accentColor, + ), ), tapOnlyMode: true, itemPadding: EdgeInsets.symmetric(horizontal: 4.0), @@ -161,7 +186,7 @@ class DoctorView extends StatelessWidget { // filledIcon: Icons.star, // emptyIcon: Icons.star_border, // ), - if (isShowFlag) + if (widget.isShowFlag) Icon( Icons.arrow_forward, color: Theme.of(context).primaryColor, @@ -183,13 +208,13 @@ class DoctorView extends StatelessWidget { showDentalChiefComplaintsList(BuildContext context) { HospitalsModel selectedHospital = new HospitalsModel(); - selectedHospital.name = doctor.projectName; + selectedHospital.name = widget.doctor.projectName; ListClinicCentralized selectedClinic = new ListClinicCentralized(); - selectedClinic.clinicDescription = doctor.clinicName; + selectedClinic.clinicDescription = widget.doctor.clinicName; SearchInfo searchInfo = new SearchInfo(); - searchInfo.ProjectID = doctor.projectID; - searchInfo.ClinicID = doctor.clinicID; + searchInfo.ProjectID = widget.doctor.projectID; + searchInfo.ClinicID = widget.doctor.clinicID; searchInfo.date = DateTime.now(); searchInfo.hospital = selectedHospital; searchInfo.clinic = selectedClinic; @@ -260,8 +285,14 @@ class DoctorView extends StatelessWidget { } void next(BuildContext context) { - Navigator.push(context, - FadePage(page: ObGyneTimeSlots(projectID: doctor.projectID!, selectedClinicID: doctor.clinicID!, selectedDoctorID: doctor.doctorID!, obGyneProcedureListResponse: obGyneProcedureListResponse!))); + Navigator.push( + context, + FadePage( + page: ObGyneTimeSlots( + projectID: widget.doctor.projectID!, + selectedClinicID: widget.doctor.clinicID!, + selectedDoctorID: widget.doctor.doctorID!, + obGyneProcedureListResponse: widget.obGyneProcedureListResponse!))); } Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo, bool isContinueDentalPlan = false}) async { @@ -270,13 +301,17 @@ class DoctorView extends StatelessWidget { FadePage( page: DoctorProfile( doctor: docObject, - isLiveCareAppointment: isLiveCareAppointment!, + isLiveCareAppointment: widget.isLiveCareAppointment!, docProfileList: docProfile, isOpenAppt: isAppo, - isDoctorNameSearch: isDoctorNameSearch, + isDoctorNameSearch: widget.isDoctorNameSearch, isContinueDentalPlan: isContinueDentalPlan, ), ), ); } + + @override + // TODO: implement wantKeepAlive + bool get wantKeepAlive => true; } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 91092bb3..31ad875e 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1445,6 +1445,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { + GifLoaderDialogUtils.hideDialog(context); log("failureResult: ${failureResult.toString()}"); AppToast.showErrorToast(message: failureResult.toString()); }, diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 8b567556..c5fb2c2e 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -329,6 +329,7 @@ class _ConfirmPaymentPageState extends State { payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { + GifLoaderDialogUtils.hideDialog(context); log("failureResult: ${failureResult.toString()}"); AppToast.showErrorToast(message: failureResult.toString()); }, diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index 3f61f3e9..44484373 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -95,7 +95,7 @@ class _RateAppointmentClinicState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - MyRichText(TranslationBase.of(context).clinic + ":", model.appointmentDetails.projectName, projectViewModel.isArabic), + MyRichText(TranslationBase.of(context).clinic + ":", model.appointmentDetails.projectName ?? "", projectViewModel.isArabic), MyRichText(TranslationBase.of(context).date + ":", DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.appointmentDetails.appointmentDate)), projectViewModel.isArabic), ], diff --git a/lib/services/payfort_services/payfort_service.dart b/lib/services/payfort_services/payfort_service.dart index 4cc203e2..5dba1b46 100644 --- a/lib/services/payfort_services/payfort_service.dart +++ b/lib/services/payfort_services/payfort_service.dart @@ -176,6 +176,7 @@ class PayfortService extends BaseService { merchantReference: merchantReference!, currency: currency, customerIp: (await _info.getWifiIP() ?? ''), + language: 'en' ); _payfort.callPayFortForApplePay( diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f353eec2..9ffec736 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -38,9 +38,9 @@ class MyInAppBrowser extends InAppBrowser { static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index b2c7b34a..ef058f9b 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -41,7 +41,6 @@ class AppExpandableNotifier extends StatefulWidget { } class _AppExpandableNotifier extends State { - late ProjectViewModel projectViewModel; @override void initState() { @@ -56,10 +55,9 @@ class _AppExpandableNotifier extends State { @override Widget build(BuildContext context) { - projectViewModel = Provider.of(context); String _mainTitle = (widget.title ?? TranslationBase.of(context).details).trim(); - String _title = _mainTitle.contains(" ") ? (projectViewModel.isArabic ? (_mainTitle.split(" ").length < 1 ? _mainTitle : _mainTitle.split(" ")[1]) : _mainTitle.split(" ")[0]) : _mainTitle; + String _title = _mainTitle.contains(" ") ? (context.read().isArabic ? (_mainTitle.split(" ").length < 1 ? _mainTitle : _mainTitle.split(" ")[1]) : _mainTitle.split(" ")[0]) : _mainTitle; // String _title = _mainTitle.split(" ")[0]; String _subTitle = _mainTitle.replaceAll(_title, "").trim();