fix issue after merge the dev

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

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

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

Loading…
Cancel
Save