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
Problems with setstate #1
Comments
I will try to reproduce the issue and see, if I can help |
Adding a key of type UniqueKey should do the trick for you. I was able to reproduce your issue in a fresh project, when leaving that out. I also tested running it without null safety so here you go:
I didn't write the package myself, but it is reliant on a key to generate an image out of your sticker constellation. As long as the widget is used stateless with nonchanging values, it shouldn't be a problem, but since you try to adjust the panelHeight dynamically with changing the state, the build of StickIt will be recalled, which leads to the key being null and creating the issue. I think usually one shouldn't manage the state about keys like the original owner does, but I am not too deep in that topic either. Here's the full class, (I had to use an appbar, because I couldnt click your button):
Also don't forget, if you use the packages I used in my example for saving the images, you have to go through the installation processes of the packages. Some of them require changing your |
it works! huge thanks @NicolasDurant 🥇 👍 |
Glad it works now! |
I try to change the panelHeight and update the screen by setstate, but the StickIt widget seems to be corrupt as soon as I use setstate
Error after using after setstate:
[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Null check operator used on a null value
E/flutter (18051): #0 _StickItState._exportImage (package:stick_it/src/stick_it.dart:192:56)
E/flutter (18051): #1 StickIt.exportImage (package:stick_it/src/stick_it.dart:94:51)
code:
,
I do not use null safety (unfortunately that is not possible)
thanks for help
The text was updated successfully, but these errors were encountered: