If I pick the image without closing the widget on profile screen, image is display without an error
Actual Behavior
If I close the widget on profile screen and then try to pick image, error is thrown after the setState(() { });
Additional Information
Error output:
======== Exception caught by foundation library ====================================================
The following assertion was thrown while dispatching notifications for EmailVerificationController:
setState() called after dispose(): _EmailVerificationBadgeState#cd282(lifecycle state: defunct, not mounted)
This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback.
The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree.
This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose().
When the exception was thrown, this was the stack:
#0 State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1167:9)
#1 State.setState (package:flutter/src/widgets/framework.dart:1202:6)
#2 _EmailVerificationBadgeState.service.<anonymous closure> (package:firebase_ui_auth/src/screens/profile_screen.dart:359:7)
#3 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:433:24)
#4 ValueNotifier.value= (package:flutter/src/foundation/change_notifier.dart:555:5)
#5 EmailVerificationController.reload (package:firebase_ui_auth/src/email_verification.dart:89:7)
<asynchronous suspension>
The EmailVerificationController sending notification was: EmailVerificationController#9f882(EmailVerificationState.unverified)
Is there an existing issue for this?
What plugin is this bug for?
Firebase UI Auth
What platform(s) does this bug affect?
Android
List of dependencies used.
flutter pub deps -s list
Steps to reproduce
I can reproduce this bug in my app when I:
Expected Behavior
If I pick the image without closing the widget on profile screen, image is display without an error
Actual Behavior
If I close the widget on profile screen and then try to pick image, error is thrown after the
setState(() { });
Additional Information
Error output: