-
Notifications
You must be signed in to change notification settings - Fork 140
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
Make compatible with hot reload #30
Comments
Definitely need some help since I don't know why hot reload don't affect. |
I found this, maybe we stuck in this case: Detail here |
I'm using it within a PostFrameCallback where I async call a
to additionally ask a isFirstLaunch variable (SharedPreferences). Maybe hot reload is lost somewhere on the path. However, I don't know of another way to check if it's the first launch, where we usually want to have intro slides, I guess. |
As @duytq94 said, neither hot-reload and setState are possible to change IntroSlider widget as widgets are computed on IntroSlider initState. In order to achieve this, this would require to change all widgets computation to build method instead of initState. |
Can you please give a detailed resolution or workaround ? |
In Flutter there are two type of widgets, Stateless and Stateful Widgets. As I said in my last reply, a workaround would be creating a new IntroSlider each time you want to change that state of the widget. |
It will be really helpful to me and to others if you can share your piece of code where you render IntroSlider. I have completely moved initState computation in build method before it renders anything. But by creating new IntroSlider, will we lose the previous IntroSlider's state ? |
If you are using initState, you should also implement onDidUpdateWidget (to reflect changes of the widget on the Intro Slider state). Otherwise, you also prohibit a switch of light/dark mode or a change of the system language to be reflected. |
I'd like to resurrect #18 because indeed hot reload would be very useful. For me, it's not working even when I use the suggested
The text was updated successfully, but these errors were encountered: