Description
While showing easyloading from actionsheet it throws exception sometime
ERROR MESSAGE
═══════ Exception caught by widgets library ═══════════════════
Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe.
E/flutter ( 2346): At this point the state of the widget's element tree is no longer stable.
E/flutter ( 2346): To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling dependOnInheritedWidgetOfExactType() in the widget's didChangeDependencies() method.
Flutter/Dart info
[✓] Flutter (Channel dev, v1.16.4-pre.33, on Mac OS X 10.15.4 19E287, locale en-GB)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
✗ Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit visit
https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions.
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.45.0)
[✓] Connected device (1 available)
This is my code structure:
_signingOutUser(BuildContext context) async {
PlatformActionSheet().displaySheet(
context: context,
actions: [
ActionSheetAction(
text: "Logout",
hasArrow: false,
onPressed: () async {
(isIos) ? pop() : Navigator.pop(context);
EasyLoading.show(status: "Logging out...");
await SessionService.shared.clearSession(
callback: () {
EasyLoading.dismiss();
Future.delayed(Utils.keyboardDismissalDuration, () {
pushAndRemoveUntil(
LoginScreen(),
);
});
},
);
},
),
],
);
}
and I wrapped the root widget with FlutterEasyLoading().
Thanks in advance