diff --git a/lib/src/form/src/helpers/form_group_helper.dart b/lib/src/form/src/helpers/form_group_helper.dart index dfd1595..b934b8f 100644 --- a/lib/src/form/src/helpers/form_group_helper.dart +++ b/lib/src/form/src/helpers/form_group_helper.dart @@ -12,7 +12,15 @@ class AstromicGroupHandler { int get count => _ids.value.length; - ValueNotifier> get _ids => _ctrl.groupIds(_groupId, _parentUuid); + ValueNotifier> get _ids { + try { + return _ctrl.groupIds(_groupId, _parentUuid); + } catch (e) { + // Fallback to an empty notifier to prevent the UI from crashing + // while the controller catches up + return ValueNotifier>([]); + } + } /// Registers a new instance within this group and optionally hydrates it with [initialData]. ///