Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ListView loses scroll position when using InheritedWidget in Flutter

Tags:

People also ask

How do I scroll to a specific position in ListView flutter?

A scroll controller creates a [ScrollPosition] to manage the state-specific to an individual [Scrollable] widget. To use a custom [ScrollPosition], subclass [ScrollController] and override [createScrollPosition]. A [ScrollController] is a [Listenable].

What can I use instead of ListView in flutter?

ListView is a very important widget in a flutter. It is used to create the list of children But when we want to create a list recursively without writing code again and again then ListView. builder is used instead of ListView.


After adding InheritedWidget to app I recognize that ListView loses scroll position (selected item index) when I come back to list from details screen using Pop().

I know that widget can be rebuild any time but maybe someone can suggest solution without handling cache manually.

P.S. Scroll position was fine before implementing InheritedWidget