|
|
|
@ -16,33 +16,17 @@ import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class PrescriptionsPage extends StatelessWidget {
|
|
|
|
class PrescriptionsPage extends StatelessWidget {
|
|
|
|
final VoidCallback showOrderLog;
|
|
|
|
final VoidCallback showOrderLog;
|
|
|
|
|
|
|
|
final FilterType filterType;
|
|
|
|
final PrescriptionsViewModel prescriptionsViewModel;
|
|
|
|
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
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
return AppScaffold(
|
|
|
|
return AppScaffold(
|
|
|
|
baseViewModel: prescriptionsViewModel,
|
|
|
|
baseViewModel: prescriptionsViewModel,
|
|
|
|
body: FractionallySizedBox(
|
|
|
|
body: ListView.separated(
|
|
|
|
widthFactor: 1.0,
|
|
|
|
|
|
|
|
child: ListView(
|
|
|
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
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),
|
|
|
|
padding: EdgeInsets.only(top: 12),
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
@ -52,9 +36,9 @@ class PrescriptionsPage extends StatelessWidget {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
List<Prescriptions> prescriptionsList = prescriptionsViewModel.prescriptionsOrderList[index].prescriptionsList;
|
|
|
|
List<Prescriptions> prescriptionsList = prescriptionsViewModel.prescriptionsOrderListByValue(filterType)[index].prescriptionsList;
|
|
|
|
return AppExpandableNotifier(
|
|
|
|
return AppExpandableNotifier(
|
|
|
|
title: prescriptionsViewModel.prescriptionsOrderList[index].filterName,
|
|
|
|
title: prescriptionsViewModel.prescriptionsOrderListByValue(filterType)[index].filterName,
|
|
|
|
bodyWidget: ListView.separated(
|
|
|
|
bodyWidget: ListView.separated(
|
|
|
|
shrinkWrap: true,
|
|
|
|
shrinkWrap: true,
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
@ -91,11 +75,7 @@ class PrescriptionsPage extends StatelessWidget {
|
|
|
|
itemCount: prescriptionsList.length),
|
|
|
|
itemCount: prescriptionsList.length),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
itemCount: prescriptionsViewModel.prescriptionsOrderList.length,
|
|
|
|
itemCount: prescriptionsViewModel.prescriptionsOrderListByValue(filterType).length,
|
|
|
|
)
|
|
|
|
));
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|