0

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

Francesco Iapicca
  • 2,618
  • 5
  • 40
  • 85

1 Answers1

1

set physics property of PageView

physics: NeverScrollableScrollPhysics()

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

Yadu
  • 2,979
  • 2
  • 12
  • 27
  • following your suggestion I changed the implementation as follow https://dartpad.dartlang.org/c3476573514298b9885b78a0275c744c and works as intended thank you @Yadu – Francesco Iapicca Aug 19 '20 at 09:23