From c8ddb363b1ec9967cbf5a2a2618201097f1d5dde Mon Sep 17 00:00:00 2001 From: ruinivist Date: Thu, 23 Oct 2025 01:46:52 +0000 Subject: [PATCH] add func to check if child with id exists already --- CHANGELOG.md | 4 ++++ lib/core/controller/controller.dart | 5 +++++ pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f58c8c..3328e4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,3 +13,7 @@ ## 1.0.3 - Update example + +## 1.0.4 + +- Add `hasChild` method to controller diff --git a/lib/core/controller/controller.dart b/lib/core/controller/controller.dart index 5d99894..59a44c4 100644 --- a/lib/core/controller/controller.dart +++ b/lib/core/controller/controller.dart @@ -241,6 +241,11 @@ class LazyCanvasController with ChangeNotifier { markDirty(); } + /// Returns true if the child exists, false otherwise. + bool hasChild(CanvasChildId id) { + return _children.containsKey(id); + } + // ==================== Positioning Logic ==================== /// Currently rendered widgets with their position info diff --git a/pubspec.yaml b/pubspec.yaml index d09a152..c156f14 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: infinite_lazy_grid description: "infinitely scrollable and zoomable grid layout with lazy loading capabilities." -version: 1.0.3 +version: 1.0.4 homepage: https://github.com/ruinivist/infinite_lazy_grid environment: