0

Im currently creating my first Desktop App:

NavigationView

  • NavigationPane
    • PaneItem(Downloads)
    • Paneitem(Settings)

The pane items are individual Stateful Widgets in classes, they are ScaffoldPages to be specific. I want to keep the state of "downloads" alive, when I switch back and forth between the two pages. The AutomaticKeepAliveClientMixin doesn't seem to work. From the Downloads Widget: (I followed the steps as described in the docs):

with AutomaticKeepAliveClientMixin<DownloadsTab>
bool get wantKeepAlive => true;
super.build(context);

Basically I'm loading YouTube Videos from an user-input into a ListView on the Downloads Tab, and when I switch to Settings and back, the list is empty again and the progress is lost.

I'm looking for a solution or an alternative.

Thanks for your time.

pedrek
  • 69
  • 1
  • 5

1 Answers1

0

i faced the same issue too but when i used indexStack combined with AutomaticKeepAliveClientMixin it worked but the only drawback was i didnt know how i was going to use navigationView. but try using indexStack and see if it will work for you

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 09 '23 at 04:54