0

Problem: I am using a bottomAppBar to host 4 tabs with ListViews in them. However, the scroll position resets each time I navigate back and forth. I need it to save the user' scroll position.

I know you can use a PageStorageKey inside a TabBarView, but I am wondering if there is an equivalent method for bottomAppBar.

Code I'm using: https://medium.com/coding-with-flutter/flutter-bottomappbar-navigation-with-fab-8b962bb55013

Thanks!

DrainBramage
  • 167
  • 1
  • 4
  • 11

1 Answers1

0

PageStorageKey would be the easiest way.

For Listview to do the same, store the offset of each listView in the mainPage then everytime you change page, rebuild the page with a scroll controller in the listview pointing to the stored offset.

0xCCY
  • 555
  • 2
  • 10
  • Appreciate the feedback - any way you could provide an example? Thanks! – DrainBramage Feb 20 '19 at 02:02
  • https://medium.com/@boldijar.paul/flutter-keeping-list-view-index-while-changing-page-view-c260352f35f8 I managed to find one on Medium. – 0xCCY Feb 20 '19 at 02:06