From 66e33b708537ff0fd4ccc4c4c4f683534777543b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 25 Aug 2021 11:26:41 +0300 Subject: [PATCH 1/3] fix error happen while scrolling --- lib/screens/doctor/doctor_reply_screen.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index 9047bb2d..fa5ae47d 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -58,8 +58,8 @@ class _DoctorReplyScreenState extends State { child: NotificationListener( child: ListView.builder( scrollDirection: Axis.vertical, + itemCount: model.listDoctorWorkingHoursTable.length, shrinkWrap: true, - itemBuilder: (BuildContext ctxt, int index) { return Column( children: [ @@ -83,20 +83,20 @@ class _DoctorReplyScreenState extends State { reply: model .listDoctorWorkingHoursTable[index]), ), - if(model.state == ViewState.BusyLocal &&index ==model.listDoctorWorkingHoursTable.length-1) + if(model.state == ViewState.BusyLocal && index == model.listDoctorWorkingHoursTable.length-1) DrAppCircularProgressIndeicator() ], ); }), - onNotification: (t) { + onNotification: (t) { if (t is ScrollEndNotification && model.state != ViewState.BusyLocal) { print("${model.state}"); - setState(() { - pageIndex++; - }); - model.getDoctorReply(pageIndex: pageIndex); + // setState(() { + // pageIndex++; + // }); + model.getDoctorReply(pageIndex: 2); } return; }, From bf12203e816fceccb150164a8b8154ab61d1bbd3 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 25 Aug 2021 11:27:39 +0300 Subject: [PATCH 2/3] fix error happen while scrolling --- lib/screens/doctor/doctor_reply_screen.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index fa5ae47d..2d74a2cc 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -92,10 +92,9 @@ class _DoctorReplyScreenState extends State { onNotification: (t) { if (t is ScrollEndNotification && model.state != ViewState.BusyLocal) { - print("${model.state}"); - // setState(() { - // pageIndex++; - // }); + setState(() { + pageIndex++; + }); model.getDoctorReply(pageIndex: 2); } return; From 076301e91a21b60d46191cd59e51f8ea8c4ca516 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 25 Aug 2021 11:28:20 +0300 Subject: [PATCH 3/3] fix error happen while scrolling --- lib/screens/doctor/doctor_reply_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index 2d74a2cc..e56360e7 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -95,7 +95,7 @@ class _DoctorReplyScreenState extends State { setState(() { pageIndex++; }); - model.getDoctorReply(pageIndex: 2); + model.getDoctorReply(pageIndex: pageIndex); } return; },