diff --git a/lib/src/form/src/controller.dart b/lib/src/form/src/controller.dart index 5a1262a..5711bcc 100644 --- a/lib/src/form/src/controller.dart +++ b/lib/src/form/src/controller.dart @@ -336,7 +336,9 @@ class AstromicFormController extends FormController { // Recursively handle subgroups if (groupStructure.subGroups != null && groupStructure.subGroups!.isNotEmpty) { for (final (FormGroupStructure subGroup, int subgroupInitialCount) in groupStructure.subGroups!) { - final String nestedPrefix = '$parentPrefix${standeredGroupFormat(groupStructure.id, groupIndex, subGroup.id)}'; + final String nestedPrefix = parentPrefix.isEmpty + ? standeredGroupFormat(groupStructure.id, groupIndex, subGroup.id) // If no parentPrefix, use the group directly + : '$parentPrefix->${standeredGroupFormat(groupStructure.id, groupIndex, subGroup.id)}'; // Add to parentPrefix // Initialize subgroup controllers recursively for (int subIndex = 0; subIndex < subgroupInitialCount; subIndex++) {