Hot Reload Error This widget has been unmounted, so the State no longer has a context
FlutterError (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.)
@Stage18 Can you please share some code snippets and steps using which we can replicate the issue?
It happens for sure when app UI is generated dynamically so the GlobalKey must be also generated on demand.
mapOfShowCaseGlobalKeys.putIfAbsent(nameOfTheGlobalKey, () => GlobalKey());
instead of
mapOfShowCaseGlobalKeys[nameOfTheGlobalKey] = GlobalKey();
Maybe it's the case in your issue @Stage18. Instead of generating new global keys for every UI state, try to generate it once, and keep them in memory and assign them to the same widgets.
Thanks a lot @7AveNooN7 ! It was my issue
++ Adrien
It happens for sure when app UI is generated dynamically so the GlobalKey must be also generated on demand.
mapOfShowCaseGlobalKeys.putIfAbsent(nameOfTheGlobalKey, () => GlobalKey());instead of
mapOfShowCaseGlobalKeys[nameOfTheGlobalKey] = GlobalKey();Maybe it's the case in your issue @Stage18. Instead of generating new global keys for every UI state, try to generate it once, and keep them in memory and assign them to the same widgets.
Hi @7AveNooN7 Thanks for contributing to the issue, @Stage18 Can you please confirm that your issue has been resolved by the changes suggested by @7AveNooN7?
Seems like provided solutions by @7AveNooN7 fixes the issue, So closing this issue for now. Feel free to reopen the issue if any assistance is required.