[SYNC]
This commit is contained in:
@@ -73,11 +73,6 @@ class AstromicFormController extends FormController {
|
||||
for (MapEntry<String, bool> fieldEntry in groupStructure.fields.entries) {
|
||||
String fieldID = '${groupStructure.id}-$i-${fieldEntry.key}';
|
||||
controller(fieldID);
|
||||
// if (fieldEntry.value) {
|
||||
// // Is a value field
|
||||
// } else {
|
||||
// // Is a text field
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,20 +116,27 @@ class AstromicFormController extends FormController {
|
||||
}
|
||||
}
|
||||
|
||||
print('Got the structure: $groupStructure');
|
||||
|
||||
// Get the current fields with this ID
|
||||
Map<String, String> firstSetOfFieldsWithID = Map<String, String>.fromEntries(
|
||||
controllers.entries.where((MapEntry<String, String> c) => RegExp(formGroupID + r'-#[\d+]-' + groupStructure!.fields.entries.first.key).hasMatch(c.key)).nonNulls.toList(),
|
||||
);
|
||||
|
||||
print('First set of fields: $firstSetOfFieldsWithID');
|
||||
// get the fields IDs
|
||||
List<String> fieldsIDs = groupStructure!.fields.entries.where((MapEntry<String, bool> e) => !e.value).nonNulls.map((MapEntry<String, bool> ee) => ee.key).toList();
|
||||
print('fieldIDs: $fieldsIDs');
|
||||
// get the values IDs
|
||||
List<String> valuesIDs = groupStructure.fields.entries.where((MapEntry<String, bool> e) => e.value).nonNulls.map((MapEntry<String, bool> ee) => ee.key).toList();
|
||||
print('valueIDs: $valuesIDs');
|
||||
|
||||
// get the subGroups
|
||||
List<FormGroupValue> subValues = <FormGroupValue>[];
|
||||
if (groupStructure.subGroups != null && groupStructure.subGroups!.isNotEmpty) {
|
||||
subValues = groupStructure.subGroups!.map((FormGroupStructure s) => getFormGroupValue(s.id, isSubGroup: true)).nonNulls.toList();
|
||||
}
|
||||
print('subValues: $subValues');
|
||||
|
||||
List<FormGroupInstance> instances = <FormGroupInstance>[];
|
||||
for (int i = 0; i < firstSetOfFieldsWithID.length; i++) {
|
||||
@@ -192,7 +194,6 @@ class AstromicFormController extends FormController {
|
||||
// }
|
||||
// }
|
||||
|
||||
void getFormGroupValues(FormGroupStructure group) {}
|
||||
|
||||
// Map<String,Map<String,dynamic>> getFormGroup(String groupID){}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user