-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Every time menu item is clicked, screen is loaded again. How to solve this? #1
Comments
I'm sure it depends on the onTap implementation on your project. In example project, you can do it by checking first if the type is changed or still the same, such as here. By checking first using:
It will make sure the content will only be reload when the type changed. On normal application, we don't even need to use _appKey, since we don't have to refresh the application to see the theme changes. So we can set onTap by directly navigate to the intended page. |
"It will make sure the content will only be reload when the type changed." |
Ok. First thing, this example needs reload because it needs to show many ways to use this drawer. In normal application, we usually stick with one theme. So you don't need to copy the example as it is. |
So, in normal application, the menu item will be like:
the |
And in normal application we don't need to set _appKey like in here. So the app will simply be:
In this example project, _appKey is necessary to force flutter to refresh application every time it needs to change the theme. |
No description provided.
The text was updated successfully, but these errors were encountered: