crop_your_image
crop_your_image copied to clipboard
[ISSUE] Unhandled Exception: This widget has been unmounted, so the State no longer has a context (and should be considered defunct).
When closing page with CropEditor there is error in the console.
It happens in the method _resetCroppingArea when getting screenSize from context:
void _resetCroppingArea() {
final screenSize = MediaQuery.of(context).size;
final imageRatio = _targetImage!.width / _targetImage!.height;
_isFitVertically = imageRatio < screenSize.aspectRatio;
_imageRect = calculator.imageRect(screenSize, imageRatio);
_resizeWith(widget.aspectRatio, widget.initialArea);
}
Same issue.
@PTLam25 @ShineYang Hi, thank you for the issue.
I guess _CropEditor
needs proper dispose()
method.
Wait for update or I'll appreciate your pull requests if you have an idea to solve this.
Same Problem here...
Still a problem. EDIT: You can hide the error with:
I'm having the same issue in my WidgetTests, where this Widget is shown on one of my app pages:
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞══ The following assertion was thrown running a test (but after the test had completed): This widget has been unmounted, so the State no longer has a context (and should be considered defunct). Consider canceling any active work during "dispose" or using the "mounted" getter to determine if the State is still active.
When the exception was thrown, this was the stack:
#0 State.context.
Would appreciate an update. Thanks so much :)