fix issue after merge the dev

merge-requests/829/head
Elham Rababh 4 years ago
parent cdc3b36174
commit de5621a629

@ -152,8 +152,9 @@ class _InPatientListPageState extends State<InPatientListPage> {
setState(() {
hasQuery = true;
});
widget.patientSearchViewModel
.filterSearchResults(value, isAllClinic: isAllClinic, isMyInPatient:widget.isMyInPatient);
widget.patientSearchViewModel.filterSearchResults(value,
isAllClinic: isAllClinic,
isMyInPatient: widget.isMyInPatient);
}),
Positioned(
right: 35,
@ -170,7 +171,9 @@ class _InPatientListPageState extends State<InPatientListPage> {
onPressed: () {
GifLoaderDialogUtils.showMyDialog(context);
widget.patientSearchViewModel.sortInPatient(
isDes: isSortDes, isAllClinic: isAllClinic, isMyInPatient:widget.isMyInPatient);
isDes: isSortDes,
isAllClinic: isAllClinic,
isMyInPatient: widget.isMyInPatient);
isSortDes = !isSortDes;
GifLoaderDialogUtils.hideDialog(context);
},
@ -197,6 +200,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
: ListOfAllInPatient(
isAllClinic: isAllClinic,
hasQuery: hasQuery,
scrollController: _scrollController,
patientSearchViewModel:
widget.patientSearchViewModel)
: NoData()
@ -261,6 +265,3 @@ class _InPatientListPageState extends State<InPatientListPage> {
);
}
}

@ -11,22 +11,26 @@ class ListOfAllInPatient extends StatelessWidget {
@required this.isAllClinic,
@required this.hasQuery,
this.patientSearchViewModel,
this.scrollController,
}) : super(key: key);
final bool isAllClinic;
final bool hasQuery;
final ScrollController scrollController;
final PatientSearchViewModel patientSearchViewModel;
@override
Widget build(BuildContext context) {
return Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0),
child: patientSearchViewModel.filteredInPatientItems.length == 0
? NoData()
:NotificationListener(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0),
child: patientSearchViewModel.filteredInPatientItems.length == 0
? NoData()
: NotificationListener<ScrollEndNotification>(
child: ListView.builder(
controller: scrollController,
itemCount:
patientSearchViewModel.filteredInPatientItems.length,
scrollDirection: Axis.vertical,
@ -104,21 +108,21 @@ class ListOfAllInPatient extends StatelessWidget {
// else
// return SizedBox();
}),
onNotification: (t) {
if (isAllClinic && !hasQuery) if (t
onNotification: (notification) {
if (isAllClinic && !hasQuery) if (notification
is ScrollUpdateNotification) {
if (t.metrics.pixels >= t.metrics.maxScrollExtent - 50) {
if (notification.metrics.pixels >= notification.metrics.maxScrollExtent - 50) {
patientSearchViewModel.addOnFilteredList();
}
if (t.metrics.pixels <= t.metrics.minScrollExtent - 50) {
if (notification.metrics.pixels <= notification.metrics.minScrollExtent - 50) {
patientSearchViewModel.removeOnFilteredList();
}
}
return;
},
),
),
),
);
}
}

Loading…
Cancel
Save