You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I use the pageView to switch to the bottom menu, initState of the current page will be triggered again when I enter the "from" page on one TAB and then return to the "from" page and cut to another TAB. But I have to do all TAB page is "AutomaticKeepAliveClientMixin" processing.
**To Reproduce**
Steps to reproduce the behavior:
Expected behavior
I want to switch from the TAB page to another TAB page without triggering "initState" repeatedly.
Flutter Version:
1.12.13+hotfix.9
Get Version:
^1.11.1
Describe on which device you found the bug:
all
Minimal reproduce code
Provide a minimum reproduction code for the problem
The text was updated successfully, but these errors were encountered:
Sorry, none of this has anything to do with this lib.
If you are unsure of how to use Flutter, open an issue in Flutter or StackOverflow.
If you have any questions regarding Get, do not hesitate to open another issue.
And just to help you, your problem is in:
children: _pages
You should never return a function in a widget or list of widgets.
Create a StatefulWidget for each page, use const in the constructs of each one, and call them const inside of children:, and it will not be rebuilt again with setState.
I know that in many languages (like javascript) you can do this, and in dart it works, but it is bad practice and causes side effects, like rebuilding every setState, as mentioned
Describe the bug
When I use the pageView to switch to the bottom menu, initState of the current page will be triggered again when I enter the "from" page on one TAB and then return to the "from" page and cut to another TAB. But I have to do all TAB page is "AutomaticKeepAliveClientMixin" processing.
**To
![image](https://user-images.githubusercontent.com/19320137/80444710-f0442280-8944-11ea-9a20-8ea5722a60e1.png)
Reproduce**
Steps to reproduce the behavior:
Expected behavior
I want to switch from the TAB page to another TAB page without triggering "initState" repeatedly.
Flutter Version:
1.12.13+hotfix.9
Get Version:
^1.11.1
Describe on which device you found the bug:
all
Minimal reproduce code
Provide a minimum reproduction code for the problem
The text was updated successfully, but these errors were encountered: