Closed duytient31 closed 1 year ago
I have similar question, when you switch tabs, the tab's widget's states are recreated, causing the page rerendered, how to keep the state?
Hi @zzt741 !
Sure! It's the keepAlive
(I thought it best to keep the same name used by Flutter)
https://github.com/caduandrade/tabbed_view#keep-alive
List<TabData> tabs = [];
tabs.add(TabData(
text: 'Tab',
content: Padding(child: Text('Hello'), padding: EdgeInsets.all(8))));
tabs.add(TabData(
text: 'TextField',
content: Padding(
child: TextField(
decoration: InputDecoration(
isDense: true, border: OutlineInputBorder())),
padding: EdgeInsets.all(8)),
keepAlive: true));
TabbedViewController controller = TabbedViewController(tabs);
TabbedView tabbedView = TabbedView(controller: controller);
@duytient31 , I'm considering that your question is the same ok?
Hi @duytient31!
Sorry, I do not understand. I don't know if you're talking about the hidden tabs. If so, this is dynamic and only occurs when there is no space for them to be displayed on the screen.