|
|
|
|
@ -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;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|