|
|
|
|
@ -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<SearchResultWithTab> {
|
|
|
|
|
body: widget.patientDoctorAppointmentListHospital
|
|
|
|
|
.registeredDoctorMap?.isNotEmpty ==
|
|
|
|
|
true
|
|
|
|
|
? SingleChildScrollView(
|
|
|
|
|
child: Column(children: <Widget>[
|
|
|
|
|
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: <Widget>[
|
|
|
|
|
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: <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) {
|
|
|
|
|
),
|
|
|
|
|
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: <Widget>[
|
|
|
|
|
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<SearchResultWithTab> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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(
|
|
|
|
|
|