8

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

moonvader
  • 19,761
  • 18
  • 67
  • 116

1 Answers1

22

no any code so a shot in the dark

try to add 'key' like this

ListView(
   key: const PageStorageKey<String>('some unique text'),
   //other parameters
);