Closed R3HP closed 2 days ago
There was a similar issue, it was suggested to set paneBodyBuilder:
paneBodyBuilder: (item, body) {
return body!;
},
However it doesn't work. Adding value keys for PaneItem and/or the body doesn't work as well.
There was a similar issue, it was suggested to set paneBodyBuilder:
paneBodyBuilder: (item, body) { return body!; },
However it doesn't work. Adding value keys for PaneItem and/or the body doesn't work as well.
Tnx I'll check it out
Thank you! Oh, by the way, it rebuilds a header every time you switch between panes.
NavigationPane(
header: const HomePageHeader(),
...
);
class HomePageHeader extends StatelessWidget {
const HomePageHeader({super.key});
@override
Widget build(BuildContext context) {
print('I am being rebuilt! :(');
...
This is the expected behavior. The widget is disposed when the content is gone and initialized when it is requested again. Use paneBodyBuilder
to maintain your very own body logic, using IndexedStack
, for example:
NavigationView(
paneBodyBuilder: (item, body) {
return IndexedStack(
index: currentIndex,
children: [ ... ],
);
},
)
Describe the bug PaneItem body widget is re created on navigating back to the page . so if i have a query initiated in body's 'initState()' it re runs again.
To Reproduce Steps to reproduce the behavior:
Example Code
Expected behavior i believed the screens would be maintained or at least the state of widgets would be maintained.