|
|
|
|
@ -32,13 +32,21 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
bool isAllClinic = true;
|
|
|
|
|
bool showBottomSheet = false;
|
|
|
|
|
String selectedClinicName;
|
|
|
|
|
ScrollController _scrollController;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
_searchController.dispose();
|
|
|
|
|
_scrollController.dispose();
|
|
|
|
|
super.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
_scrollController = new ScrollController();
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
@ -167,13 +175,14 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
: Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 16.0),
|
|
|
|
|
child: NotificationListener(
|
|
|
|
|
child: NotificationListener<ScrollEndNotification>(
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
itemCount: widget.patientSearchViewModel
|
|
|
|
|
.filteredInPatientItems.length,
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
// physics: ScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
controller: _scrollController,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
if (!widget.isMyInPatient)
|
|
|
|
|
return PatientCard(
|
|
|
|
|
@ -276,14 +285,19 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
else
|
|
|
|
|
return SizedBox();
|
|
|
|
|
}),
|
|
|
|
|
onNotification: (t) {
|
|
|
|
|
if (isAllClinic) if (t
|
|
|
|
|
onNotification: (notification) {
|
|
|
|
|
if (isAllClinic) if (notification
|
|
|
|
|
is ScrollUpdateNotification &&
|
|
|
|
|
t.metrics.pixels >=
|
|
|
|
|
t.metrics.maxScrollExtent - 50) {
|
|
|
|
|
notification.metrics.pixels >=
|
|
|
|
|
notification.metrics.maxScrollExtent - 50) {
|
|
|
|
|
widget.patientSearchViewModel
|
|
|
|
|
.addOnFilteredList();
|
|
|
|
|
}
|
|
|
|
|
// print("scroll position scroll ${_scrollController.position.pixels}");
|
|
|
|
|
// if(_scrollController.position.pixels > widget.patientSearchViewModel
|
|
|
|
|
// .filteredInPatientItems.length / 4){
|
|
|
|
|
// _scrollController.jumpTo(0);
|
|
|
|
|
// }
|
|
|
|
|
return;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
|