diff --git a/lib/services/field_images.dart b/lib/services/field_images.dart index f6dac855..a0685305 100644 --- a/lib/services/field_images.dart +++ b/lib/services/field_images.dart @@ -106,7 +106,7 @@ class Field { void loadFieldImage() { fieldImage = Image.asset(jsonData['field-image']); fieldImage.image - .resolve(const ImageConfiguration()) + .resolve(ImageConfiguration.empty) .addListener(ImageStreamListener((image, synchronousCall) { fieldImageWidth = image.image.width; fieldImageHeight = image.image.height; @@ -115,11 +115,11 @@ class Field { })); } - void dispose() { + void dispose() async { instanceCounter--; if (instanceCounter <= 0) { - fieldImage.image.evict(); - PaintingBinding.instance.imageCache.clear(); + await fieldImage.image.evict(); + imageCache.clear(); fieldImageLoaded = false; } } diff --git a/lib/widgets/draggable_containers/models/list_layout_model.dart b/lib/widgets/draggable_containers/models/list_layout_model.dart index 90556888..66676671 100644 --- a/lib/widgets/draggable_containers/models/list_layout_model.dart +++ b/lib/widgets/draggable_containers/models/list_layout_model.dart @@ -238,6 +238,7 @@ class ListLayoutModel extends LayoutContainerModel { container.unSubscribe(); container.disposeModel( deleting: true); + container.forceDispose(); notifyListeners(); }); diff --git a/lib/widgets/nt_widgets/nt_widget.dart b/lib/widgets/nt_widgets/nt_widget.dart index 8e814320..ac426a9a 100644 --- a/lib/widgets/nt_widgets/nt_widget.dart +++ b/lib/widgets/nt_widgets/nt_widget.dart @@ -233,7 +233,6 @@ class NTWidgetModel extends ChangeNotifier { } void forceDispose() { - disposeWidget(deleting: true); _forceDispose = true; dispose(); }