caduandrade / multi_split_view

Provides horizontal or vertical multiple split view for Flutter.
https://caduandrade.github.io/multi_split_view/
MIT License
129 stars 24 forks source link

keepAlive property similar to Tabbed view #74

Open Haugpro opened 2 weeks ago

Haugpro commented 2 weeks ago

using multi_split_view I have to take special care that the 'Area' content views will not be recreated on every build(). Your tabbed_view component takes care of this by means of the 'keepAlive' property we can set 'true' for each 'TabData' element. Is it possible to add that feature to the Area of multi_split_view also? Thank you

caduandrade commented 2 weeks ago

Hi @Haugpro!

I released a new version (3.2.0) where areas have IDs. This ID is used as internal Key. If you want to rebuild the layout, it is necessary to instantiate new areas using the same ID to maintain the state (Flutter recreates the state when the tree structure changes and does not have the same Key).

In this case keepAlive is not enough because it is not yet possible to change an area, it is necessary to instantiate a new Area object. When it is possible to change the values ​​of the Area, keepAlive will also not be necessary as the Key will be reused, ok? This means Flutter will not discard the state when its tree structure changes.

Haugpro commented 2 weeks ago

ah, I used version 3.1.0 since it was the default some days ago. Will test again with 3.2.0. Thank you very much for helping