I have a list builder which listens for changes to a riverpod provider state property ‘isScrolling’ and as part of a Listener onPointerDown event I set the ‘isScrolling’ state to true.
The ListView does not automatically start scrolling even though it has detected and rendered the change, I have to take my finger off and start scrolling again, or add a second finger to start the scroll. Is there a way to get the physics to apply whilst the initial finger that started the event stays on the device?
I am new to Flutter so I am open to any solutions to allow the requirement to be met.
final isScrolling = ref.watch(provider.select((s) => s.isScrolling));
Listener(
onPointerDown: (event) {
// gesture logic here
ref.read(provider.notifier).setIsScrolling(true);
},
child: ListView.builder(
itemCount: 3,
scrollDirection: Axis.vertical,
physics: isScrolling == true ? const AlwaysScrollableScrollPhysics() : const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return Column(
children: [
///
],
);
},
),
)
},
The requirement is because I have child widgets that listen to ‘isScrolling’ state and disable canvas drawing to allow the user to scroll, pan & zoom.