-
Notifications
You must be signed in to change notification settings - Fork 75
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
[Bug]: Crash when creating a CropRotateEditor #237
Comments
Thank you for all the information. This issue will be a challenge to resolve because, as you mentioned, “The problem is, sometimes, and only sometimes,” which complicates troubleshooting. It appears there was an issue in calculating the image size before rendering, which is essential for the transformations to function correctly. However, if I can find time over the next few days, I’ll take a closer look to see if I can identify a solution. One small thing you could try, which may help resolve the issue, is to load the image into the cache before opening the editor. This could potentially resolve the issue cuz all image information is faster available for the image editor. final content = await image.readAsBytes();
/// Add the code below
await precacheImage(
MemoryImage(content),
context,
);
await Navigator.push(...) |
Yes the provided solution did indeed fix the issue. However this is a temporary fix and we'll be expecting a global fix soon. |
After a few more tests, it seems the issue still exists. The solution provided did in fact mitigate the number of times it happens, but it does in fact still happen. |
This issue is stale because it has been open for 3 days with no activity. |
Package Version
5.4.1
Flutter Version
3.24.3
Platforms
Android
How to reproduce?
When creating a CropRotateEditor, sometimes the editor turns completly black, as if the image was unable to be loaded, and a buch of errors shows on the logs.
For context, I am implementing a user profile picture up-loader, that's the 'image' variable below, the up-loader itself is working fine, allowing me to select a file from the gallery.
The problem is, sometimes, and only sometimes, when opening the editor as shown below, the entire thing crashes. Other times, this codes works perfectly and does exactly everything right, no problems at all, even multiple times in a row.
This odd behavior is making things hard to debug.
Logs (optional)
The relevant error-causing widget was:
Show
Example code (optional)
The text was updated successfully, but these errors were encountered: