diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ceb94c73..efcd2053 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -23,6 +23,7 @@ const Map platformLocalizedValues = { }; const Map localizedValues = { + 'kilometerUnit': {'en': 'KM', 'ar': 'كيلومتر'}, 'dashboardScreenToolbarTitle': {'ar': 'الرئيسة', 'en': 'Home'}, 'settings': {'en': 'Settings', 'ar': 'الاعدادات'}, 'language': {'en': 'App Language', 'ar': 'لغة التطبيق'}, @@ -2146,7 +2147,10 @@ const Map localizedValues = { "selectFacitlity": {"en": "Select Facility", "ar": "اختر المنشأة"}, "selectDoctor": {"en": "Select Doctor", "ar": "اختر الطبيب"}, "hmgHospital": {"en": "HMG Hospital", "ar": "مستشفى HMG"}, - "hmcHospital": {"en": "HMC", "ar": "HMC"}, - "hmcHospitalCount": {"en": "@ HMC", "ar": "@ HMC"}, + "hmcHospital": {"en": "HMG Medical Center", "ar": "مركز إتش إم جي الطبي"}, + "hmcHospitalCount": { + "en": "@ HMG Medical Center", + "ar": "@ مركز إتش إم جي الطبي" + }, "hmgHospitalCount": {"en": "@ HMG Hospital", "ar": "@ مستشفى HMG"}, }; diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 08e7c51e..0e5d430b 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -10,8 +10,8 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/LaserBooking.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResultsByRegion.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/dialog/clinic_list_dialog.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/SearchResultWithTab.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/doctor_response_mapper.dart'; @@ -719,7 +719,7 @@ class _SearchByClinicState extends State { Navigator.push( context, FadePage( - page: SearchResultsByRegion( + page: SearchResultWithTab( doctorsList: [], patientDoctorAppointmentListHospital: regionHospitalList, isLiveCareAppointment: false, diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 3a908c25..256b4d7d 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -1,7 +1,6 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResultsByRegion.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -15,6 +14,7 @@ import 'package:provider/provider.dart'; import '../../../services/appointment_services/doctor_response_mapper.dart'; import '../../../services/authentication/auth_provider.dart'; +import '../search_result/SearchResultWithTab.dart'; class SearchByDoctor extends StatefulWidget { @override @@ -201,7 +201,7 @@ class _SearchByDoctorState extends State { Navigator.push( context, FadePage( - page: SearchResultsByRegion( + page: SearchResultWithTab( doctorsList: [], patientDoctorAppointmentListHospital: regionHospitalList, isLiveCareAppointment: false, diff --git a/lib/pages/BookAppointment/search_result/ResultByDoctors.dart b/lib/pages/BookAppointment/search_result/ResultByDoctors.dart index 6ca315c5..97e0ff05 100644 --- a/lib/pages/BookAppointment/search_result/ResultByDoctors.dart +++ b/lib/pages/BookAppointment/search_result/ResultByDoctors.dart @@ -2,19 +2,13 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; -import 'package:diplomaticquarterapp/theme/colors.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; class ResultByDoctor extends StatelessWidget { List doctorsList = []; List? patientDoctorAppointmentListHospital; - Function(int) onDoctorSelected; final bool isLiveCareAppointment; final bool isObGyneAppointment; final bool isDoctorNameSearch; @@ -23,7 +17,6 @@ class ResultByDoctor extends StatelessWidget { ResultByDoctor( {required this.doctorsList, required this.patientDoctorAppointmentListHospital, - required this.onDoctorSelected, required this.isLiveCareAppointment, required this.isObGyneAppointment, required this.isDoctorNameSearch, @@ -36,40 +29,41 @@ class ResultByDoctor extends StatelessWidget { return SizedBox( child: patientDoctorAppointmentListHospital?.isNotEmpty == true - ? ListView.separated( - addAutomaticKeepAlives: true, - physics: BouncingScrollPhysics(), - separatorBuilder: (context, index) { - return Material( - color: Color(0xFFf5f5f5), - child: SizedBox( - height: 12, - ), - ); - }, - itemBuilder: (context, index) { - final doctor = patientDoctorAppointmentListHospital![index]; + ? Padding( + padding: const EdgeInsets.all(12.0), + child: ListView.separated( + addAutomaticKeepAlives: true, + physics: BouncingScrollPhysics(), + separatorBuilder: (context, index) { + return Material( + color: Color(0xFFf5f5f5), + child: SizedBox( + height: 12, + ), + ); + }, + itemBuilder: (context, index) { + final doctor = patientDoctorAppointmentListHospital![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); - }); - - }, - itemCount: patientDoctorAppointmentListHospital?.length ?? - 0, - ) + 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); + }); + }, + itemCount: patientDoctorAppointmentListHospital?.length ?? 0, + ), + ) : getNoDataWidget(context), ); } diff --git a/lib/pages/BookAppointment/search_result/ResultByFacility.dart b/lib/pages/BookAppointment/search_result/ResultByFacility.dart index 8eb5f71d..37113341 100644 --- a/lib/pages/BookAppointment/search_result/ResultByFacility.dart +++ b/lib/pages/BookAppointment/search_result/ResultByFacility.dart @@ -1,15 +1,8 @@ -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; -import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:provider/provider.dart'; typedef OnFacilitySelected = Function(bool); @@ -29,23 +22,38 @@ class ResultByFacility extends StatelessWidget { Widget build(BuildContext context) { return Column( children: [ - HospitalTitle( - iconUrl: 'assets/images/svg/HMG.svg', - title: TranslationBase.of(context).hmgHospital, - isHMC: false, - itemCount: - "${patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmgSize ?? 0}", - nearest: patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmgDistance - + InkWell( + onTap: () { + if (patientDoctorAppointmentListHospital + .registeredDoctorMap?[selectedRegion]?.hmgSize == + 0) return; + onFacilitySelected(false); + }, + child: HospitalTitle( + iconUrl: 'assets/images/svg/HMG.svg', + title: TranslationBase.of(context).hmgHospital, + isHMC: false, + itemCount: + "${patientDoctorAppointmentListHospital.registeredDoctorMap?[selectedRegion]?.hmgSize ?? 0}", + nearest: patientDoctorAppointmentListHospital + .registeredDoctorMap?[selectedRegion]?.hmgDistance), ), SizedBox(height: 16,), - HospitalTitle( - iconUrl: 'assets/images/svg/HMC.svg', - title: TranslationBase.of(context).hmcHospital, - isHMC: true, - itemCount: - "${patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmcSize ?? 0}", - nearest: patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmcDistance + InkWell( + onTap: () { + if (patientDoctorAppointmentListHospital + .registeredDoctorMap?[selectedRegion]?.hmcSize == + 0) return; + onFacilitySelected(false); + }, + child: HospitalTitle( + iconUrl: 'assets/images/svg/HMC.svg', + title: TranslationBase.of(context).hmcHospital, + isHMC: true, + itemCount: + "${patientDoctorAppointmentListHospital.registeredDoctorMap?[selectedRegion]?.hmcSize ?? 0}", + nearest: patientDoctorAppointmentListHospital + .registeredDoctorMap?[selectedRegion]?.hmcDistance), ) ]); } @@ -67,57 +75,87 @@ class HospitalTitle extends StatelessWidget { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - SvgPicture.asset(iconUrl), - SizedBox( - width: 8, - ), - Text( - title, - style: TextStyle( - fontSize: 18, - color: isHMC ? Color(0xFF40ACC9) : Color(0xFFD02127), - fontWeight: FontWeight.w600), + return Material( + color: Colors.white, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + SvgPicture.asset(iconUrl), + SizedBox( + width: 8, + ), + Text( + title, + style: TextStyle( + fontSize: 18, + color: + isHMC ? Color(0xFF40ACC9) : Color(0xFFD02127), + fontWeight: FontWeight.w600), + ), + ], + ), + SizedBox( + height: 6, + ), + Row( + children: [ + Text( + isHMC + ? "${TranslationBase.of(context).hmcHospitalCount.replaceAll("@", itemCount)}" + : "${TranslationBase.of(context).hmgHospitalCount.replaceAll("@", itemCount)}", + style: TextStyle( + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.w600), + ), + Visibility( + visible: nearest != double.infinity, + child: Row( + children: [ + SizedBox( + width: 8, + ), + Icon( + Icons.location_on, + color: Colors.black, + ), + SizedBox( + width: 8, + ), + Text( + "${TranslationBase.of(context).nearest}: $nearest ${TranslationBase.of(context).kilometerUnit}", + style: TextStyle( + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.w600), + ), + ], + ), + ), + ], + ), + ], ), - ], - ), - SizedBox( - height: 6, - ), - Row( - children: [ - Text( - isHMC - ? "${TranslationBase.of(context).hmcHospitalCount.replaceAll("@", itemCount)}" - : "${TranslationBase.of(context).hmgHospitalCount.replaceAll("@", itemCount)}", - style: TextStyle( - fontSize: 12, color: Colors.black, fontWeight: FontWeight.w600), - ), - - Visibility( - visible: nearest != double.infinity, - child: Row( - children: [ - SizedBox(width: 8,), - Icon(Icons.location_on, color: Colors.black,), - SizedBox(width: 8,), - Text( - "${TranslationBase.of(context).nearest}: $nearest", - style: TextStyle( - fontSize: 12, color: Colors.black, fontWeight: FontWeight.w600), - ), - ], + ), + Padding( + padding: EdgeInsets.all(8), + child: Center( + child: Icon( + Icons.arrow_forward_ios, + color: CustomColors.black, + size: 16, ), ), - ], - ), - ], + ), + ], + ), ), ); } diff --git a/lib/pages/BookAppointment/search_result/ResultByHospital.dart b/lib/pages/BookAppointment/search_result/ResultByHospital.dart index d60d3738..b7682e3e 100644 --- a/lib/pages/BookAppointment/search_result/ResultByHospital.dart +++ b/lib/pages/BookAppointment/search_result/ResultByHospital.dart @@ -1,15 +1,8 @@ -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:provider/provider.dart'; typedef OnHospitalSelected = Function(String, int); @@ -80,7 +73,7 @@ class HospitalBodyWidget extends StatelessWidget { return ListView.separated( addAutomaticKeepAlives: true, shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + physics: BouncingScrollPhysics(), itemCount: patientDoctorAppointmentListHospital?.length ?? 0, separatorBuilder: (context, index) { return Container( @@ -98,7 +91,8 @@ class HospitalBodyWidget extends StatelessWidget { child: Material( color: CustomColors.white, child: Padding( - padding: const EdgeInsets.all(8.0), + padding: + const EdgeInsets.symmetric(horizontal: 16, vertical: 24), child: Row( children: [ Expanded( @@ -132,7 +126,7 @@ class HospitalBodyWidget extends StatelessWidget { width: 8, ), Text( - "${TranslationBase.of(context).nearest}: ${patientDoctorAppointmentListHospital?[index].distanceInKMs}", + "${TranslationBase.of(context).nearest}: ${patientDoctorAppointmentListHospital?[index].distanceInKMs} ${TranslationBase.of(context).kilometerUnit}", style: TextStyle( fontSize: 14, color: Colors.black, diff --git a/lib/pages/BookAppointment/search_result/ResultByRegion.dart b/lib/pages/BookAppointment/search_result/ResultByRegion.dart index 86a973a8..11d6b68c 100644 --- a/lib/pages/BookAppointment/search_result/ResultByRegion.dart +++ b/lib/pages/BookAppointment/search_result/ResultByRegion.dart @@ -1,15 +1,8 @@ -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; -import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:provider/provider.dart'; typedef OnRegionSelected = Function(String); class ResultByRegion extends StatelessWidget { List doctorsList = []; @@ -88,8 +81,8 @@ class RegionTitle extends StatelessWidget { return Material( color: CustomColors.white, child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24), + child: Row( children: [ Expanded( child: Column( diff --git a/lib/pages/BookAppointment/search_result/SearchResultWithTab.dart b/lib/pages/BookAppointment/search_result/SearchResultWithTab.dart index 39e08949..d1d15e5b 100644 --- a/lib/pages/BookAppointment/search_result/SearchResultWithTab.dart +++ b/lib/pages/BookAppointment/search_result/SearchResultWithTab.dart @@ -1,6 +1,8 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByDoctors.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByFacility.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByHospital.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByRegion.dart'; @@ -65,144 +67,182 @@ class _SearchResultWithTabState extends State { body: widget.patientDoctorAppointmentListHospital .registeredDoctorMap?.isNotEmpty == true - ? SingleChildScrollView( - child: Column(children: [ - Container( - width: double.infinity, - padding: EdgeInsets.only(left: 20, right: 20, top: 12), - child: Row( - children: [ - Expanded( - child: showProgress( - title: TranslationBase - .of(context) - .selectRegion, - status: _currentIndex == 0 - ? TranslationBase - .of(context) - .inPrgress - : _currentIndex > 0 - ? TranslationBase - .of(context) - .completed - : TranslationBase - .of(context) - .locked, - color: _currentIndex == 0 - ? CustomColors.orange - : CustomColors.green, - ), - ), - Expanded( - child: showProgress( - title: TranslationBase - .of(context) - .selectFacitlity, - status: _currentIndex == 1 - ? TranslationBase - .of(context) - .inPrgress - : _currentIndex > 1 - ? TranslationBase - .of(context) - .completed - : TranslationBase - .of(context) - .locked, - color: _currentIndex == 1 - ? CustomColors.orange - : _currentIndex > 1 - ? CustomColors.green - : CustomColors.grey2, - ), + ? SizedBox( + height: SizeConfig.realScreenHeight! * .9, + width: SizeConfig.realScreenWidth, + child: Column(children: [ + Container( + width: double.infinity, + padding: EdgeInsets.only(left: 20, right: 20, top: 12), + child: Row( + children: [ + Expanded( + child: showProgress( + title: TranslationBase.of(context).selectRegion, + status: _currentIndex == 0 + ? TranslationBase.of(context).inPrgress + : _currentIndex > 0 + ? TranslationBase.of(context).completed + : TranslationBase.of(context).locked, + color: _currentIndex == 0 + ? CustomColors.orange + : CustomColors.green, + onTap: () { + setState(() { + selectedHospitalIndex = -1; + selectedRegion = ""; + _currentIndex = 0; + changePageViewIndex(0); + }); + }), + ), + Expanded( + child: showProgress( + title: TranslationBase.of(context).selectFacitlity, + status: _currentIndex == 1 + ? TranslationBase.of(context).inPrgress + : _currentIndex > 1 + ? TranslationBase.of(context).completed + : TranslationBase.of(context).locked, + color: _currentIndex == 1 + ? CustomColors.orange + : _currentIndex > 1 + ? CustomColors.green + : CustomColors.grey2, + onTap: () { + setState(() { + selectedHospitalIndex = -1; + _currentIndex = 1; + changePageViewIndex(1); + }); + }), + ), + Expanded( + child: showProgress( + title: TranslationBase.of(context).selectBranch, + status: _currentIndex == 2 + ? TranslationBase.of(context).inPrgress + : _currentIndex > 1 + ? TranslationBase.of(context).completed + : TranslationBase.of(context).locked, + color: _currentIndex == 2 + ? CustomColors.orange + : _currentIndex > 2 + ? CustomColors.green + : CustomColors.grey2, + onTap: () { + setState(() { + selectedHospitalIndex = -1; + _currentIndex = 2; + changePageViewIndex(2); + }); + }), + ), + showProgress( + title: TranslationBase.of(context).selectDoctor, + status: _currentIndex == 3 + ? TranslationBase.of(context).inPrgress + : TranslationBase.of(context).locked, + color: _currentIndex == 3 + ? CustomColors.orange + : _currentIndex > 4 + ? CustomColors.green + : CustomColors.grey2, + isNeedBorder: false, + onTap: () { + setState(() { + _currentIndex = 3; + changePageViewIndex(3); + }); + }), + ], ), - showProgress( - title: TranslationBase - .of(context) - .selectBranch, - status: _currentIndex == 2 ? TranslationBase - .of(context) - .inPrgress : TranslationBase - .of(context) - .locked, - color: _currentIndex == 2 - ? CustomColors.orange - : _currentIndex > 3 - ? CustomColors.green - : CustomColors.grey2, - isNeedBorder: false, - ), - showProgress( - title: TranslationBase - .of(context) - .selectDoctor, - status: _currentIndex == 3 ? TranslationBase - .of(context) - .inPrgress : TranslationBase - .of(context) - .locked, - color: _currentIndex == 3 - ? CustomColors.orange - : _currentIndex > 4 - ? CustomColors.green - : CustomColors.grey2, - isNeedBorder: false, - ), - ], - ), - ), - Expanded( - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - ResultByRegion(doctorsList: widget.doctorsList, - patientDoctorAppointmentListHospital: widget - .patientDoctorAppointmentListHospital, - onRegionSelected: (key) { - setState(() { - selectedRegion = key; - }); - }), - (selectedRegion != "") - ? - ResultByFacility(doctorsList: widget.doctorsList, - patientDoctorAppointmentListHospital: widget - .patientDoctorAppointmentListHospital, - selectedRegion: selectedRegion, - onFacilitySelected: (isHMCSelected) { + ), + mHeight(24), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { setState(() { - isHMCSelected = isHMCSelected; + _currentIndex = index; }); }, - - ) : SizedBox.shrink(), - (selectedRegion != '') ? - ResultByHospital(doctorsList: widget.doctorsList, - paitientDoctorAppointmentList: (isHMCSelected)? - widget.patientDoctorAppointmentListHospital - .registeredDoctorMap![selectedRegion]!.hmgDoctorList ?? [] - : widget.patientDoctorAppointmentListHospital - .registeredDoctorMap?[selectedRegion]?.hmgDoctorList ?? [], - isHMCSelected: isHMCSelected, - isLiveCareAppointment: widget.isLiveCareAppointment, - isDoctorSearchResult: widget.isDoctorSearchResult, - onHospitalSelected: (hospital,index) { + scrollDirection: Axis.horizontal, + children: [ + ResultByRegion( + doctorsList: widget.doctorsList, + patientDoctorAppointmentListHospital: + widget.patientDoctorAppointmentListHospital, + onRegionSelected: (key) { + setState(() { + selectedRegion = key; + _currentIndex = 1; + changePageViewIndex(1); + }); + }), + (selectedRegion != "") + ? ResultByFacility( + doctorsList: widget.doctorsList, + patientDoctorAppointmentListHospital: + widget.patientDoctorAppointmentListHospital, + selectedRegion: selectedRegion, + onFacilitySelected: (isHMCSelected) { + setState(() { + isHMCSelected = isHMCSelected; + _currentIndex = 2; + changePageViewIndex(2); + }); + }, + ) : SizedBox.shrink(), + (selectedRegion != '') ? + ResultByHospital(doctorsList: widget.doctorsList, + paitientDoctorAppointmentList: (isHMCSelected) ? + widget.patientDoctorAppointmentListHospital + .registeredDoctorMap![selectedRegion]! + .hmgDoctorList ?? [] + : widget.patientDoctorAppointmentListHospital + .registeredDoctorMap?[selectedRegion] + ?.hmcDoctorList ?? [], + isHMCSelected: isHMCSelected, + isLiveCareAppointment: widget.isLiveCareAppointment, + isDoctorSearchResult: widget.isDoctorSearchResult, + onHospitalSelected: (hospital, index) { setState(() { selectedHospitalIndex = index; - }); - }): SizedBox.shrink(), - - ], - ), + _currentIndex = 3; + changePageViewIndex(3); + }); + }) + : SizedBox.shrink(), + (selectedRegion != '' && selectedHospitalIndex != -1) + ? ResultByDoctor( + doctorsList: widget.doctorsList, + patientDoctorAppointmentListHospital: (isHMCSelected) + ? widget + .patientDoctorAppointmentListHospital + .registeredDoctorMap![selectedRegion]! + .hmgDoctorList![selectedHospitalIndex] + .patientDoctorAppointmentList ?? + [] + : widget + .patientDoctorAppointmentListHospital + .registeredDoctorMap?[selectedRegion] + ?.hmcDoctorList?[ + selectedHospitalIndex] + .patientDoctorAppointmentList ?? + [], + isLiveCareAppointment: + widget.isLiveCareAppointment, + isDoctorSearchResult: widget.isDoctorSearchResult, + isObGyneAppointment: widget.isObGyneAppointment, + isDoctorNameSearch: widget.isDoctorNameSearch) + : SizedBox.shrink(), + ], ), - ])) + ), + ]), + ) : getNoDataWidget(context),); } @@ -229,13 +269,17 @@ class _SearchResultWithTabState extends State { } Widget showProgress( - {String? title, String? status, Color? color, bool isNeedBorder = true}) { + {String? title, + String? status, + Color? color, + bool isNeedBorder = true, + Function()? onTap}) { return InkWell( onTap: () { if (status == TranslationBase .of(context) .completed) { - changePageViewIndex(_currentIndex); + onTap?.call(); } }, child: Column( diff --git a/lib/pages/conference/zoom/call_screen.dart b/lib/pages/conference/zoom/call_screen.dart index 2a5b4e40..355842e0 100644 --- a/lib/pages/conference/zoom/call_screen.dart +++ b/lib/pages/conference/zoom/call_screen.dart @@ -472,7 +472,8 @@ class _CallScreenState extends State { ], ), ); - if (errorType == Errors.SessionJoinFailed || errorType == Errors.SessionDisconncting) { + if (errorType == Errors.SessionJoinFailed || + errorType == Errors.SessionDisconnecting) { Timer( const Duration(milliseconds: 1000), () => Navigator.pop(context), diff --git a/lib/pages/login/register_new.dart b/lib/pages/login/register_new.dart index dac74122..8a5b5ec8 100644 --- a/lib/pages/login/register_new.dart +++ b/lib/pages/login/register_new.dart @@ -1,17 +1,15 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart'; -import 'package:diplomaticquarterapp/pages/login/register.dart'; import 'package:diplomaticquarterapp/pages/login/register-info.dart'; +import 'package:diplomaticquarterapp/pages/login/register.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/pages/login/confirm-login.dart'; class RegisterNew extends StatefulWidget { @override @@ -117,7 +115,14 @@ class _RegisterNew extends State { }, scrollDirection: Axis.horizontal, children: [ + Register( + changePageViewIndex: changePageViewIndex, + ), + RegisterInfo( + changePageViewIndex: changePageViewIndex, + ), + RegisterInfo(changePageViewIndex: changePageViewIndex, page: 2), // NewEReferralStepOnePage( // changePageViewIndex: changePageViewIndex, // createEReferralRequestModel: createEReferralRequestModel, diff --git a/lib/services/appointment_services/doctor_response_mapper.dart b/lib/services/appointment_services/doctor_response_mapper.dart index 16b7ac7c..c9c0b1de 100644 --- a/lib/services/appointment_services/doctor_response_mapper.dart +++ b/lib/services/appointment_services/doctor_response_mapper.dart @@ -40,6 +40,13 @@ class DoctorMapper{ if(regionDoctorList!.distance>element.projectDistanceInKiloMeters){ regionDoctorList!.distance = element.projectDistanceInKiloMeters; } + if (element.isHMC == true && + element.projectDistanceInKiloMeters < + regionDoctorList.hmcDistance) + regionDoctorList.hmcDistance = element.projectDistanceInKiloMeters; + else if (element.projectDistanceInKiloMeters < + regionDoctorList.hmgDistance) + regionDoctorList.hmgDistance = element.projectDistanceInKiloMeters; }else if (await sharedPref.getDouble(USER_LAT) != null && await sharedPref.getDouble(USER_LONG) != null && element.latitude != null && element.longitude != null) { var lat = await sharedPref.getDouble(USER_LAT); @@ -51,11 +58,14 @@ class DoctorMapper{ } if(regionDoctorList!.distance>distance){ regionDoctorList!.distance = distance; - if(element.isHMC == true) - regionDoctorList.hmcDistance = distance; - else - regionDoctorList.hmgDistance = distance; } + if (element.isHMC == true && + element.projectDistanceInKiloMeters < + regionDoctorList.hmcDistance) + regionDoctorList.hmcDistance = element.projectDistanceInKiloMeters; + else if (element.projectDistanceInKiloMeters < + regionDoctorList.hmgDistance) + regionDoctorList.hmgDistance = element.projectDistanceInKiloMeters; print("the distance is $distance"); } targetList?.add(newAppointment); diff --git a/lib/uitl/app_toast.dart b/lib/uitl/app_toast.dart index 3e1f08b5..bbeebe5d 100644 --- a/lib/uitl/app_toast.dart +++ b/lib/uitl/app_toast.dart @@ -70,7 +70,7 @@ class AppToast { child: toast, gravity: ToastGravity.TOP, toastDuration: Duration(seconds: timeInSeconds), - positionedToastBuilder: (context, child,_) { + positionedToastBuilder: (context, child) { return Positioned(top: 50, left: 10, right: 10, child: child); }); // Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.red, textColor: textColor, fontSize: fontSize); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 5e858cf0..b183b98c 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -3277,6 +3277,8 @@ class TranslationBase { String get hmgHospitalCount => localizedValues["hmgHospitalCount"][locale.languageCode]; String get nearest => localizedValues["nearest"][locale.languageCode]; + String get kilometerUnit => + localizedValues["kilometerUnit"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate {