|
|
|
|
@ -16,86 +16,66 @@ import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class PrescriptionsPage extends StatelessWidget {
|
|
|
|
|
final VoidCallback showOrderLog;
|
|
|
|
|
final FilterType filterType;
|
|
|
|
|
final PrescriptionsViewModel prescriptionsViewModel;
|
|
|
|
|
|
|
|
|
|
const PrescriptionsPage({Key key, this.prescriptionsViewModel, this.showOrderLog}) : super(key: key);
|
|
|
|
|
const PrescriptionsPage(this.filterType, {Key key, this.prescriptionsViewModel, this.showOrderLog}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
baseViewModel: prescriptionsViewModel,
|
|
|
|
|
body: FractionallySizedBox(
|
|
|
|
|
widthFactor: 1.0,
|
|
|
|
|
child: ListView(
|
|
|
|
|
baseViewModel: prescriptionsViewModel,
|
|
|
|
|
body: ListView.separated(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
MyTabView(TranslationBase.of(context).byClinic, FilterType.Clinic, prescriptionsViewModel.filterType, () {
|
|
|
|
|
prescriptionsViewModel.setFilterType(FilterType.Clinic);
|
|
|
|
|
}),
|
|
|
|
|
MyTabView(TranslationBase.of(context).byHospital, FilterType.Hospital, prescriptionsViewModel.filterType, () {
|
|
|
|
|
prescriptionsViewModel.setFilterType(FilterType.Hospital);
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
ListView.separated(
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
padding: EdgeInsets.only(top: 12),
|
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
|
return Container(
|
|
|
|
|
height: 12,
|
|
|
|
|
margin: EdgeInsets.only(left: 21, right: 21),
|
|
|
|
|
// color: Color(0xffD9D9D9),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
List<Prescriptions> prescriptionsList = prescriptionsViewModel.prescriptionsOrderList[index].prescriptionsList;
|
|
|
|
|
return AppExpandableNotifier(
|
|
|
|
|
title: prescriptionsViewModel.prescriptionsOrderList[index].filterName,
|
|
|
|
|
bodyWidget: ListView.separated(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
|
|
|
|
|
itemBuilder: (context, _index) {
|
|
|
|
|
Prescriptions prescriptions = prescriptionsList[_index];
|
|
|
|
|
return DoctorCard(
|
|
|
|
|
onTap: () async {
|
|
|
|
|
final _shouldRecallApi = await Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: PrescriptionItemsPage(
|
|
|
|
|
prescriptions: prescriptions,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
if (_shouldRecallApi != null) {
|
|
|
|
|
showOrderLog();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
name: prescriptions.doctorName,
|
|
|
|
|
profileUrl: prescriptions.doctorImageURL,
|
|
|
|
|
rating: prescriptions.actualDoctorRate.toDouble(),
|
|
|
|
|
subName: prescriptions.name,
|
|
|
|
|
isInOutPatient: prescriptions.isInOutPatient,
|
|
|
|
|
isLiveCareAppointment: prescriptions.isLiveCareAppointment,
|
|
|
|
|
// appointmentTime: DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions
|
|
|
|
|
// .appointmentDate)),
|
|
|
|
|
date: DateUtil.convertStringToDate(prescriptions
|
|
|
|
|
.appointmentDate) //projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
itemCount: prescriptionsList.length),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
itemCount: prescriptionsViewModel.prescriptionsOrderList.length,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
padding: EdgeInsets.only(top: 12),
|
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
|
return Container(
|
|
|
|
|
height: 12,
|
|
|
|
|
margin: EdgeInsets.only(left: 21, right: 21),
|
|
|
|
|
// color: Color(0xffD9D9D9),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
List<Prescriptions> prescriptionsList = prescriptionsViewModel.prescriptionsOrderListByValue(filterType)[index].prescriptionsList;
|
|
|
|
|
return AppExpandableNotifier(
|
|
|
|
|
title: prescriptionsViewModel.prescriptionsOrderListByValue(filterType)[index].filterName,
|
|
|
|
|
bodyWidget: ListView.separated(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
|
|
|
|
|
itemBuilder: (context, _index) {
|
|
|
|
|
Prescriptions prescriptions = prescriptionsList[_index];
|
|
|
|
|
return DoctorCard(
|
|
|
|
|
onTap: () async {
|
|
|
|
|
final _shouldRecallApi = await Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: PrescriptionItemsPage(
|
|
|
|
|
prescriptions: prescriptions,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
if (_shouldRecallApi != null) {
|
|
|
|
|
showOrderLog();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
name: prescriptions.doctorName,
|
|
|
|
|
profileUrl: prescriptions.doctorImageURL,
|
|
|
|
|
rating: prescriptions.actualDoctorRate.toDouble(),
|
|
|
|
|
subName: prescriptions.name,
|
|
|
|
|
isInOutPatient: prescriptions.isInOutPatient,
|
|
|
|
|
isLiveCareAppointment: prescriptions.isLiveCareAppointment,
|
|
|
|
|
// appointmentTime: DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions
|
|
|
|
|
// .appointmentDate)),
|
|
|
|
|
date: DateUtil.convertStringToDate(prescriptions
|
|
|
|
|
.appointmentDate) //projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
itemCount: prescriptionsList.length),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
itemCount: prescriptionsViewModel.prescriptionsOrderListByValue(filterType).length,
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|