I have a very simple Flutter app with a TabBarView with two views (Tab 1 and Tab 2), one of them (Tab 1) has
Can't add a comment, so left it as answer.
If you using PageStorageKey
, have a lot of items in the ListView
, scroll down plenty items and have lag on tab switch, the solution is to provide itemExtent
to ListView
.
As I understand, without itemExtent
ListView
don't know which items immediately show, because using PageStorageKey
cashed only position in pixels, and ListView
need calculate height of all items scrolled from top. In another hand, with itemExtent
ListView
can easily calculate item to show, for example: index = cashedPositionInPixels / itemExtent
.