WD: search by region changes

merge-update-with-lab-changes
taha.alam 12 months ago
parent ae4c287af2
commit 951a5a4932

@ -23,6 +23,7 @@ const Map platformLocalizedValues = {
}; };
const Map localizedValues = { const Map localizedValues = {
'kilometerUnit': {'en': 'KM', 'ar': 'كيلومتر'},
'dashboardScreenToolbarTitle': {'ar': 'الرئيسة', 'en': 'Home'}, 'dashboardScreenToolbarTitle': {'ar': 'الرئيسة', 'en': 'Home'},
'settings': {'en': 'Settings', 'ar': 'الاعدادات'}, 'settings': {'en': 'Settings', 'ar': 'الاعدادات'},
'language': {'en': 'App Language', 'ar': 'لغة التطبيق'}, 'language': {'en': 'App Language', 'ar': 'لغة التطبيق'},
@ -2146,7 +2147,10 @@ const Map localizedValues = {
"selectFacitlity": {"en": "Select Facility", "ar": "اختر المنشأة"}, "selectFacitlity": {"en": "Select Facility", "ar": "اختر المنشأة"},
"selectDoctor": {"en": "Select Doctor", "ar": "اختر الطبيب"}, "selectDoctor": {"en": "Select Doctor", "ar": "اختر الطبيب"},
"hmgHospital": {"en": "HMG Hospital", "ar": "مستشفى HMG"}, "hmgHospital": {"en": "HMG Hospital", "ar": "مستشفى HMG"},
"hmcHospital": {"en": "HMC", "ar": "HMC"}, "hmcHospital": {"en": "HMG Medical Center", "ar": "مركز إتش إم جي الطبي"},
"hmcHospitalCount": {"en": "@ HMC", "ar": "@ HMC"}, "hmcHospitalCount": {
"en": "@ HMG Medical Center",
"ar": "@ مركز إتش إم جي الطبي"
},
"hmgHospitalCount": {"en": "@ HMG Hospital", "ar": "@ مستشفى HMG"}, "hmgHospitalCount": {"en": "@ HMG Hospital", "ar": "@ مستشفى HMG"},
}; };

@ -10,8 +10,8 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart'; import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/LaserBooking.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/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/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/appointment_services/doctor_response_mapper.dart'; import 'package:diplomaticquarterapp/services/appointment_services/doctor_response_mapper.dart';
@ -719,7 +719,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: SearchResultsByRegion( page: SearchResultWithTab(
doctorsList: [], doctorsList: [],
patientDoctorAppointmentListHospital: regionHospitalList, patientDoctorAppointmentListHospital: regionHospitalList,
isLiveCareAppointment: false, isLiveCareAppointment: false,

@ -1,7 +1,6 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.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/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/appointment_services/doctor_response_mapper.dart';
import '../../../services/authentication/auth_provider.dart'; import '../../../services/authentication/auth_provider.dart';
import '../search_result/SearchResultWithTab.dart';
class SearchByDoctor extends StatefulWidget { class SearchByDoctor extends StatefulWidget {
@override @override
@ -201,7 +201,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: SearchResultsByRegion( page: SearchResultWithTab(
doctorsList: [], doctorsList: [],
patientDoctorAppointmentListHospital: regionHospitalList, patientDoctorAppointmentListHospital: regionHospitalList,
isLiveCareAppointment: false, isLiveCareAppointment: false,

@ -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/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.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/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/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ResultByDoctor extends StatelessWidget { class ResultByDoctor extends StatelessWidget {
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
List<DoctorList>? patientDoctorAppointmentListHospital; List<DoctorList>? patientDoctorAppointmentListHospital;
Function(int) onDoctorSelected;
final bool isLiveCareAppointment; final bool isLiveCareAppointment;
final bool isObGyneAppointment; final bool isObGyneAppointment;
final bool isDoctorNameSearch; final bool isDoctorNameSearch;
@ -23,7 +17,6 @@ class ResultByDoctor extends StatelessWidget {
ResultByDoctor( ResultByDoctor(
{required this.doctorsList, {required this.doctorsList,
required this.patientDoctorAppointmentListHospital, required this.patientDoctorAppointmentListHospital,
required this.onDoctorSelected,
required this.isLiveCareAppointment, required this.isLiveCareAppointment,
required this.isObGyneAppointment, required this.isObGyneAppointment,
required this.isDoctorNameSearch, required this.isDoctorNameSearch,
@ -36,40 +29,41 @@ class ResultByDoctor extends StatelessWidget {
return SizedBox( return SizedBox(
child: patientDoctorAppointmentListHospital?.isNotEmpty == child: patientDoctorAppointmentListHospital?.isNotEmpty ==
true true
? ListView.separated( ? Padding(
addAutomaticKeepAlives: true, padding: const EdgeInsets.all(12.0),
physics: BouncingScrollPhysics(), child: ListView.separated(
separatorBuilder: (context, index) { addAutomaticKeepAlives: true,
return Material( physics: BouncingScrollPhysics(),
color: Color(0xFFf5f5f5), separatorBuilder: (context, index) {
child: SizedBox( return Material(
height: 12, color: Color(0xFFf5f5f5),
), child: SizedBox(
); height: 12,
}, ),
itemBuilder: (context, index) { );
final doctor = patientDoctorAppointmentListHospital![index]; },
itemBuilder: (context, index) {
final doctor = patientDoctorAppointmentListHospital![index];
return DoctorView( return DoctorView(
doctor: doctor, doctor: doctor,
isLiveCareAppointment: isLiveCareAppointment, isLiveCareAppointment: isLiveCareAppointment,
isObGyneAppointment: isObGyneAppointment, isObGyneAppointment: isObGyneAppointment,
isDoctorNameSearch: isDoctorNameSearch, isDoctorNameSearch: isDoctorNameSearch,
obGyneProcedureListResponse: obGyneProcedureListResponse, obGyneProcedureListResponse: obGyneProcedureListResponse,
isShowDate: false, isShowDate: false,
onTap: () { onTap: () {
context context
.read<ProjectViewModel>() .read<ProjectViewModel>()
.analytics .analytics
.appointment .appointment
.book_appointment_select_doctor( .book_appointment_select_doctor(
appointment_type: 'regular', doctor: doctor); appointment_type: 'regular', doctor: doctor);
}); });
},
}, itemCount: patientDoctorAppointmentListHospital?.length ?? 0,
itemCount: patientDoctorAppointmentListHospital?.length ?? ),
0, )
)
: getNoDataWidget(context), : getNoDataWidget(context),
); );
} }

@ -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/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/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
typedef OnFacilitySelected = Function(bool); typedef OnFacilitySelected = Function(bool);
@ -29,23 +22,38 @@ class ResultByFacility extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
children: [ children: [
HospitalTitle( InkWell(
iconUrl: 'assets/images/svg/HMG.svg', onTap: () {
title: TranslationBase.of(context).hmgHospital, if (patientDoctorAppointmentListHospital
isHMC: false, .registeredDoctorMap?[selectedRegion]?.hmgSize ==
itemCount: 0) return;
"${patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmgSize ?? 0}", onFacilitySelected(false);
nearest: patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmgDistance },
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,), SizedBox(height: 16,),
HospitalTitle( InkWell(
iconUrl: 'assets/images/svg/HMC.svg', onTap: () {
title: TranslationBase.of(context).hmcHospital, if (patientDoctorAppointmentListHospital
isHMC: true, .registeredDoctorMap?[selectedRegion]?.hmcSize ==
itemCount: 0) return;
"${patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmcSize ?? 0}", onFacilitySelected(false);
nearest: patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmcDistance },
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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Material(
padding: const EdgeInsets.all(8.0), color: Colors.white,
child: Column( child: Padding(
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
children: [ child: Row(
Row( children: [
children: [ Expanded(
SvgPicture.asset(iconUrl), child: Column(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
width: 8, children: [
), Row(
Text( children: [
title, SvgPicture.asset(iconUrl),
style: TextStyle( SizedBox(
fontSize: 18, width: 8,
color: isHMC ? Color(0xFF40ACC9) : Color(0xFFD02127), ),
fontWeight: FontWeight.w600), 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),
),
],
),
),
],
),
],
), ),
], ),
), Padding(
SizedBox( padding: EdgeInsets.all(8),
height: 6, child: Center(
), child: Icon(
Row( Icons.arrow_forward_ios,
children: [ color: CustomColors.black,
Text( size: 16,
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),
),
],
), ),
), ),
], ),
), ],
], ),
), ),
); );
} }

@ -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/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.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/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
typedef OnHospitalSelected = Function(String, int); typedef OnHospitalSelected = Function(String, int);
@ -80,7 +73,7 @@ class HospitalBodyWidget extends StatelessWidget {
return ListView.separated( return ListView.separated(
addAutomaticKeepAlives: true, addAutomaticKeepAlives: true,
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: BouncingScrollPhysics(),
itemCount: patientDoctorAppointmentListHospital?.length ?? 0, itemCount: patientDoctorAppointmentListHospital?.length ?? 0,
separatorBuilder: (context, index) { separatorBuilder: (context, index) {
return Container( return Container(
@ -98,7 +91,8 @@ class HospitalBodyWidget extends StatelessWidget {
child: Material( child: Material(
color: CustomColors.white, color: CustomColors.white,
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding:
const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
@ -132,7 +126,7 @@ class HospitalBodyWidget extends StatelessWidget {
width: 8, width: 8,
), ),
Text( Text(
"${TranslationBase.of(context).nearest}: ${patientDoctorAppointmentListHospital?[index].distanceInKMs}", "${TranslationBase.of(context).nearest}: ${patientDoctorAppointmentListHospital?[index].distanceInKMs} ${TranslationBase.of(context).kilometerUnit}",
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,

@ -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/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/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
typedef OnRegionSelected = Function(String); typedef OnRegionSelected = Function(String);
class ResultByRegion extends StatelessWidget { class ResultByRegion extends StatelessWidget {
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
@ -88,8 +81,8 @@ class RegionTitle extends StatelessWidget {
return Material( return Material(
color: CustomColors.white, color: CustomColors.white,
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.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/ResultByFacility.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByHospital.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByHospital.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByRegion.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByRegion.dart';
@ -65,144 +67,182 @@ class _SearchResultWithTabState extends State<SearchResultWithTab> {
body: widget.patientDoctorAppointmentListHospital body: widget.patientDoctorAppointmentListHospital
.registeredDoctorMap?.isNotEmpty == .registeredDoctorMap?.isNotEmpty ==
true true
? SingleChildScrollView( ? SizedBox(
child: Column(children: <Widget>[ height: SizeConfig.realScreenHeight! * .9,
Container( width: SizeConfig.realScreenWidth,
width: double.infinity, child: Column(children: <Widget>[
padding: EdgeInsets.only(left: 20, right: 20, top: 12), Container(
child: Row( width: double.infinity,
children: [ padding: EdgeInsets.only(left: 20, right: 20, top: 12),
Expanded( child: Row(
child: showProgress( children: [
title: TranslationBase Expanded(
.of(context) child: showProgress(
.selectRegion, title: TranslationBase.of(context).selectRegion,
status: _currentIndex == 0 status: _currentIndex == 0
? TranslationBase ? TranslationBase.of(context).inPrgress
.of(context) : _currentIndex > 0
.inPrgress ? TranslationBase.of(context).completed
: _currentIndex > 0 : TranslationBase.of(context).locked,
? TranslationBase color: _currentIndex == 0
.of(context) ? CustomColors.orange
.completed : CustomColors.green,
: TranslationBase onTap: () {
.of(context) setState(() {
.locked, selectedHospitalIndex = -1;
color: _currentIndex == 0 selectedRegion = "";
? CustomColors.orange _currentIndex = 0;
: CustomColors.green, changePageViewIndex(0);
), });
), }),
Expanded( ),
child: showProgress( Expanded(
title: TranslationBase child: showProgress(
.of(context) title: TranslationBase.of(context).selectFacitlity,
.selectFacitlity, status: _currentIndex == 1
status: _currentIndex == 1 ? TranslationBase.of(context).inPrgress
? TranslationBase : _currentIndex > 1
.of(context) ? TranslationBase.of(context).completed
.inPrgress : TranslationBase.of(context).locked,
: _currentIndex > 1 color: _currentIndex == 1
? TranslationBase ? CustomColors.orange
.of(context) : _currentIndex > 1
.completed ? CustomColors.green
: TranslationBase : CustomColors.grey2,
.of(context) onTap: () {
.locked, setState(() {
color: _currentIndex == 1 selectedHospitalIndex = -1;
? CustomColors.orange _currentIndex = 1;
: _currentIndex > 1 changePageViewIndex(1);
? CustomColors.green });
: CustomColors.grey2, }),
), ),
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 mHeight(24),
.of(context) Expanded(
.selectBranch, child: PageView(
status: _currentIndex == 2 ? TranslationBase physics: NeverScrollableScrollPhysics(),
.of(context) controller: _controller,
.inPrgress : TranslationBase onPageChanged: (index) {
.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: <Widget>[
ResultByRegion(doctorsList: widget.doctorsList,
patientDoctorAppointmentListHospital: widget
.patientDoctorAppointmentListHospital,
onRegionSelected: (key) {
setState(() {
selectedRegion = key;
});
}),
(selectedRegion != "")
?
ResultByFacility(doctorsList: widget.doctorsList,
patientDoctorAppointmentListHospital: widget
.patientDoctorAppointmentListHospital,
selectedRegion: selectedRegion,
onFacilitySelected: (isHMCSelected) {
setState(() { setState(() {
isHMCSelected = isHMCSelected; _currentIndex = index;
}); });
}, },
scrollDirection: Axis.horizontal,
) : SizedBox.shrink(), children: <Widget>[
(selectedRegion != '') ? ResultByRegion(
ResultByHospital(doctorsList: widget.doctorsList, doctorsList: widget.doctorsList,
paitientDoctorAppointmentList: (isHMCSelected)? patientDoctorAppointmentListHospital:
widget.patientDoctorAppointmentListHospital widget.patientDoctorAppointmentListHospital,
.registeredDoctorMap![selectedRegion]!.hmgDoctorList ?? [] onRegionSelected: (key) {
: widget.patientDoctorAppointmentListHospital setState(() {
.registeredDoctorMap?[selectedRegion]?.hmgDoctorList ?? [], selectedRegion = key;
isHMCSelected: isHMCSelected, _currentIndex = 1;
isLiveCareAppointment: widget.isLiveCareAppointment, changePageViewIndex(1);
isDoctorSearchResult: widget.isDoctorSearchResult, });
onHospitalSelected: (hospital,index) { }),
(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(() { setState(() {
selectedHospitalIndex = index; selectedHospitalIndex = index;
}); _currentIndex = 3;
}): SizedBox.shrink(), 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),); : getNoDataWidget(context),);
} }
@ -229,13 +269,17 @@ class _SearchResultWithTabState extends State<SearchResultWithTab> {
} }
Widget showProgress( Widget showProgress(
{String? title, String? status, Color? color, bool isNeedBorder = true}) { {String? title,
String? status,
Color? color,
bool isNeedBorder = true,
Function()? onTap}) {
return InkWell( return InkWell(
onTap: () { onTap: () {
if (status == TranslationBase if (status == TranslationBase
.of(context) .of(context)
.completed) { .completed) {
changePageViewIndex(_currentIndex); onTap?.call();
} }
}, },
child: Column( child: Column(

@ -472,7 +472,8 @@ class _CallScreenState extends State<CallScreen> {
], ],
), ),
); );
if (errorType == Errors.SessionJoinFailed || errorType == Errors.SessionDisconncting) { if (errorType == Errors.SessionJoinFailed ||
errorType == Errors.SessionDisconnecting) {
Timer( Timer(
const Duration(milliseconds: 1000), const Duration(milliseconds: 1000),
() => Navigator.pop(context), () => Navigator.pop(context),

@ -1,17 +1,15 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.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-info.dart';
import 'package:diplomaticquarterapp/pages/login/register.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.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:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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 { class RegisterNew extends StatefulWidget {
@override @override
@ -117,7 +115,14 @@ class _RegisterNew extends State<RegisterNew> {
}, },
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: <Widget>[ children: <Widget>[
Register(
changePageViewIndex: changePageViewIndex,
),
RegisterInfo(
changePageViewIndex: changePageViewIndex,
),
RegisterInfo(changePageViewIndex: changePageViewIndex, page: 2),
// NewEReferralStepOnePage( // NewEReferralStepOnePage(
// changePageViewIndex: changePageViewIndex, // changePageViewIndex: changePageViewIndex,
// createEReferralRequestModel: createEReferralRequestModel, // createEReferralRequestModel: createEReferralRequestModel,

@ -40,6 +40,13 @@ class DoctorMapper{
if(regionDoctorList!.distance>element.projectDistanceInKiloMeters){ if(regionDoctorList!.distance>element.projectDistanceInKiloMeters){
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 }else
if (await sharedPref.getDouble(USER_LAT) != null && await sharedPref.getDouble(USER_LONG) != null && element.latitude != null && element.longitude != null) { 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); var lat = await sharedPref.getDouble(USER_LAT);
@ -51,11 +58,14 @@ class DoctorMapper{
} }
if(regionDoctorList!.distance>distance){ if(regionDoctorList!.distance>distance){
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"); print("the distance is $distance");
} }
targetList?.add(newAppointment); targetList?.add(newAppointment);

@ -70,7 +70,7 @@ class AppToast {
child: toast, child: toast,
gravity: ToastGravity.TOP, gravity: ToastGravity.TOP,
toastDuration: Duration(seconds: timeInSeconds), toastDuration: Duration(seconds: timeInSeconds),
positionedToastBuilder: (context, child,_) { positionedToastBuilder: (context, child) {
return Positioned(top: 50, left: 10, right: 10, child: 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); // Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.red, textColor: textColor, fontSize: fontSize);

@ -3277,6 +3277,8 @@ class TranslationBase {
String get hmgHospitalCount => localizedValues["hmgHospitalCount"][locale.languageCode]; String get hmgHospitalCount => localizedValues["hmgHospitalCount"][locale.languageCode];
String get nearest => localizedValues["nearest"][locale.languageCode]; String get nearest => localizedValues["nearest"][locale.languageCode];
String get kilometerUnit =>
localizedValues["kilometerUnit"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save