|
|
|
@ -6,6 +6,8 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
|
|
|
|
@ -20,92 +22,90 @@ class PrescriptionsPage extends StatelessWidget {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
|
PatiantInformtion patient = routeArgs['patient'];
|
|
|
|
|
|
|
|
|
|
String patientType = routeArgs['patientType'];
|
|
|
|
|
String arrivalType = routeArgs['arrivalType'];
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
return BaseView<PrescriptionsViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getPrescriptions(patient),
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).prescriptions,
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
body: FractionallySizedBox(
|
|
|
|
|
widthFactor: 1.0,
|
|
|
|
|
child: ListView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () => model
|
|
|
|
|
.setFilterType(FilterType.Clinic),
|
|
|
|
|
child: ListTile(
|
|
|
|
|
title: Text(TranslationBase.of(context).clinic),
|
|
|
|
|
leading: Radio(
|
|
|
|
|
value: FilterType.Clinic,
|
|
|
|
|
groupValue: model.filterType,
|
|
|
|
|
onChanged: (FilterType value) {
|
|
|
|
|
model.setFilterType(value);
|
|
|
|
|
},
|
|
|
|
|
PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType),
|
|
|
|
|
SizedBox(height: 12,),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts('Order',style: "caption2",color: Colors.black,fontSize: 13,),
|
|
|
|
|
Texts('Prescriptions',bold: true,fontSize: 22,),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if(patientType!=null && patientType=='7')
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: (){
|
|
|
|
|
//TODO Hussam call the add page here
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
width: double.maxFinite,
|
|
|
|
|
height: 140,
|
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.grey[300],
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 90,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: 40,
|
|
|
|
|
width: 40,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.grey[600],
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Icon(Icons.add,color: Colors.white,),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 10,),
|
|
|
|
|
Texts('Apply for New Prescriptions Order',color: Colors.grey[600],fontWeight: FontWeight.w600,)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () => model
|
|
|
|
|
.setFilterType(FilterType.Hospital),
|
|
|
|
|
child: ListTile(
|
|
|
|
|
title: Text(TranslationBase.of(context).hospital),
|
|
|
|
|
leading: Radio(
|
|
|
|
|
value: FilterType.Hospital,
|
|
|
|
|
groupValue: model.filterType,
|
|
|
|
|
onChanged: (FilterType value) {
|
|
|
|
|
model.setFilterType(value);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
...List.generate(model.prescriptionsList.length, (index) => InkWell(
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: PrescriptionItemsPage(
|
|
|
|
|
prescriptions: model.prescriptionsList[index],
|
|
|
|
|
patient: patient,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: DoctorCard(
|
|
|
|
|
doctorName: model.prescriptionsList[index].doctorName,
|
|
|
|
|
profileUrl: model.prescriptionsList[index].doctorImageURL,
|
|
|
|
|
branch: model.prescriptionsList[index].name,
|
|
|
|
|
appointmentDate: DateUtils.getDateTimeFromServerFormat(model.prescriptionsList[index].appointmentDate,),
|
|
|
|
|
orderNo: model.prescriptionsList[index].appointmentNo.toString(),
|
|
|
|
|
invoiceNO:model.prescriptionsList[index].appointmentNo.toString(),
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.prescriptionsOrderList.length,
|
|
|
|
|
(index) => AppExpandableNotifier(
|
|
|
|
|
title: model
|
|
|
|
|
.prescriptionsOrderList[index].filterName,
|
|
|
|
|
bodyWidget: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: model
|
|
|
|
|
.prescriptionsOrderList[index].prescriptionsList
|
|
|
|
|
.map((prescriptions) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: PrescriptionItemsPage(
|
|
|
|
|
prescriptions: prescriptions,
|
|
|
|
|
patient: patient,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: DoctorCard(
|
|
|
|
|
doctorName: prescriptions.doctorName,
|
|
|
|
|
profileUrl: prescriptions.doctorImageURL,
|
|
|
|
|
branch: prescriptions.name,
|
|
|
|
|
appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate,),
|
|
|
|
|
orderNo: prescriptions.appointmentNo.toString(),
|
|
|
|
|
invoiceNO:prescriptions.appointmentNo.toString(),
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
)),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|