'I have three ListViews, and on iOS scroll to top scrolls all of them up

I have the following:

IndexedStack(
  index: index,
  children: [
    Scaffold(
      body: ListView(),
    ),
    Scaffold(
      body: ListView(),
    ),
    Scaffold(
      body: ListView(),
    ),
  ],
)

However, on iOS, it seems that tapping the status bar to scroll to top scrolls all of these lists to the top.

Is there any way to make this behavior work correctly? I tried to add individual controller: _scrollController to each ListView, but that then didn't make the scroll to top work at all (tapping status bar did not scroll the list view).

Any way to make this work?

Update: Thanks to @vandad answer below, also with using key of PageStorageKey on each ListView/ScrollController/etc., it is possible to have the scroll to top functionality again on each individual view.

ListView(
  key: PageStorageKey<String>("GIVE A KEY"),
...
)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source