PageController ignores Listener

Issue

I’m trying to change page in a PageView when the mouse scrolls,

I’m using a Listener following this article,

in my implementation (https://dartpad.dartlang.org/c2b24881927981575ff81367121f4e5f)

using the fabs it behave as expected:

  • move to the new page
  • print the new page number
  • then prints either next or previous page

but the callback in the Listener behave weirdly :

  • print the message from the callback
  • does NOT move to a new page
  • but then prints either next or previous page

I’m not sure what is the cause of this behavior, any idea?
Thank you

Solution

set physics property of PageView

physics: NeverScrollableScrollPhysics()

so the PageView ignores the pointer, use the feedback picked up by Listener move to pages

Answered By – Yadu

Answer Checked By – Willingham (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *