[SYNC]
This commit is contained in:
@@ -336,13 +336,13 @@ class AstromicFormController extends FormController {
|
|||||||
// Recursively handle subgroups
|
// Recursively handle subgroups
|
||||||
if (groupStructure.subGroups != null && groupStructure.subGroups!.isNotEmpty) {
|
if (groupStructure.subGroups != null && groupStructure.subGroups!.isNotEmpty) {
|
||||||
for (final (FormGroupStructure subGroup, int subgroupInitialCount) in groupStructure.subGroups!) {
|
for (final (FormGroupStructure subGroup, int subgroupInitialCount) in groupStructure.subGroups!) {
|
||||||
final String nestedPrefix = parentPrefix.isEmpty
|
final String subgroupPrefix = parentPrefix.isEmpty
|
||||||
? standeredGroupFormat(groupStructure.id, groupIndex, subGroup.id) // If no parentPrefix, use the group directly
|
? standeredGroupFormat(groupStructure.id, groupIndex, subGroup.id)
|
||||||
: '$parentPrefix->${standeredGroupFormat(groupStructure.id, groupIndex, subGroup.id)}'; // Add to parentPrefix
|
: '$parentPrefix->${standeredGroupFormat(groupStructure.id, groupIndex, subGroup.id)}'; // Add to parentPrefix only once
|
||||||
|
|
||||||
// Initialize subgroup controllers recursively
|
// Initialize subgroup controllers recursively
|
||||||
for (int subIndex = 0; subIndex < subgroupInitialCount; subIndex++) {
|
for (int subIndex = 0; subIndex < subgroupInitialCount; subIndex++) {
|
||||||
_initializeGroupControllers(subGroup, subgroupInitialCount, parentPrefix: nestedPrefix);
|
_initializeGroupControllers(subGroup, subgroupInitialCount, parentPrefix: subgroupPrefix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -362,6 +362,7 @@ class AstromicFormController extends FormController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// void initializeFormGroup(FormGroupStructure groupStructure, {int initialCount = 1}) {
|
// void initializeFormGroup(FormGroupStructure groupStructure, {int initialCount = 1}) {
|
||||||
// assert(groupStructure.fields.isNotEmpty, '$groupStructure: Group Fields should NOT be empty.');
|
// assert(groupStructure.fields.isNotEmpty, '$groupStructure: Group Fields should NOT be empty.');
|
||||||
// if (groupStructure.subGroups != null && groupStructure.subGroups!.isNotEmpty) {
|
// if (groupStructure.subGroups != null && groupStructure.subGroups!.isNotEmpty) {
|
||||||
|
|||||||
Reference in New Issue
Block a user