|
|
|
|
@ -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<DoctorView> createState() => _DoctorViewState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _DoctorViewState extends State<DoctorView> 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: <Widget>[
|
|
|
|
|
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: <Widget>[
|
|
|
|
|
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<ProjectViewModel>().isArabic),
|
|
|
|
|
if (widget.doctor.projectName != null) MyRichText(TranslationBase.of(context).branch, widget.doctor.projectName!, context.read<ProjectViewModel>().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;
|
|
|
|
|
}
|
|
|
|
|
|