I am using SingleChildScrollView and a scrollController to be notified when reaching the end of the scroll view
the SingleChildScrollView component:
Expanded(
child: SingleChildScrollView(
controller: controller.scrollController,
physics: const ScrollPhysics(),
child: Center(
child: Obx(() =>
controller.busy && controller.itemList.isEmpty
? loader
: Column(children: [
listWidget(controller.itemList),
if (controller.busy) loader
]))),
the Listener:
scrollController.addListener(() {
if (scrollController.offset >=
scrollController.position.maxScrollExtent &&
!scrollController.position.outOfRange) {
_next();
}
but for some reason it is calling _next() twice when I am reaching the end of the scroll view and not once as it should.
any idea why? am I doing something wrong?