fix
This commit is contained in:
parent
9fcc50fcc3
commit
10a0e926ad
@ -84,6 +84,12 @@ class _MountWidgetState extends State<MountWidget> {
|
|||||||
VoidCallback? _createMountHandler(context, Mount mount) {
|
VoidCallback? _createMountHandler(context, Mount mount) {
|
||||||
return _enabled && mount.mounted != null
|
return _enabled && mount.mounted != null
|
||||||
? () async {
|
? () async {
|
||||||
|
if (mount.mounted == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final mounted = mount.mounted!;
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_enabled = false;
|
_enabled = false;
|
||||||
});
|
});
|
||||||
@ -96,12 +102,12 @@ class _MountWidgetState extends State<MountWidget> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mount.mounted! && location == null) {
|
if (!mounted && location == null) {
|
||||||
displayErrorMessage(context, "Mount location is not set");
|
displayErrorMessage(context, "Mount location is not set");
|
||||||
return cleanup();
|
return cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
final success = await mount.mount(mount.mounted!, location: location);
|
final success = await mount.mount(mounted, location: location);
|
||||||
if (success ||
|
if (success ||
|
||||||
mount.mounted! ||
|
mount.mounted! ||
|
||||||
constants.navigatorKey.currentContext == null ||
|
constants.navigatorKey.currentContext == null ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user