[SYNC] Doing the initial Values thing.
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
//s2 Core Package Imports
|
//s2 Core Package Imports
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:developer';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
//s2 1st-party Package Imports
|
//s2 1st-party Package Imports
|
||||||
@@ -283,11 +284,13 @@ class AstromicFormController extends FormController {
|
|||||||
|
|
||||||
for (final String fieldID in structure.fields) {
|
for (final String fieldID in structure.fields) {
|
||||||
final String fullID = standeredGroupFormat(baseID, index.toString(), fieldID);
|
final String fullID = standeredGroupFormat(baseID, index.toString(), fieldID);
|
||||||
|
log('Trying to initialize and add $fullID');
|
||||||
controller(fullID);
|
controller(fullID);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (final String valueID in structure.values ?? <String>[]) {
|
for (final String valueID in structure.values ?? <String>[]) {
|
||||||
final String fullID = standeredGroupFormat(baseID, index.toString(), valueID);
|
final String fullID = standeredGroupFormat(baseID, index.toString(), valueID);
|
||||||
|
log('Trying to initialize and add $fullID');
|
||||||
controller(fullID);
|
controller(fullID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -586,6 +589,7 @@ class AstromicFormController extends FormController {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
_initializeFormGroups(Map<String, InitialFormGroupValue> initVals, {Map<String, int>? parents}) {
|
_initializeFormGroups(Map<String, InitialFormGroupValue> initVals, {Map<String, int>? parents}) {
|
||||||
|
log('Now we have groups, Initialize them with the parent: $parents');
|
||||||
for (MapEntry<String, InitialFormGroupValue> groupValueEntry in initVals.entries) {
|
for (MapEntry<String, InitialFormGroupValue> groupValueEntry in initVals.entries) {
|
||||||
String groupID = groupValueEntry.key;
|
String groupID = groupValueEntry.key;
|
||||||
InitialFormGroupValue groupValue = groupValueEntry.value;
|
InitialFormGroupValue groupValue = groupValueEntry.value;
|
||||||
@@ -599,6 +603,7 @@ class AstromicFormController extends FormController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String? prefix = parents?.entries.map((MapEntry<String, int> parentEntry) => standeredGroupFormat(parentEntry.key, parentEntry.value.toString(), null)).join('-');
|
String? prefix = parents?.entries.map((MapEntry<String, int> parentEntry) => standeredGroupFormat(parentEntry.key, parentEntry.value.toString(), null)).join('-');
|
||||||
|
log('Got the prefix, it\'s $prefix');
|
||||||
|
|
||||||
// Fields
|
// Fields
|
||||||
if (groupValue.fieldValues != null) {
|
if (groupValue.fieldValues != null) {
|
||||||
@@ -611,6 +616,7 @@ class AstromicFormController extends FormController {
|
|||||||
String fID = standeredGroupFormat((prefix != null ? '$prefix-' : '') + groupID, i.toString(), fieldKey);
|
String fID = standeredGroupFormat((prefix != null ? '$prefix-' : '') + groupID, i.toString(), fieldKey);
|
||||||
String? fieldValue = fve.value[i] ?? '';
|
String? fieldValue = fve.value[i] ?? '';
|
||||||
bool obscValue = groupValue.fieldObscurityValues?[fieldKey]?[i] ?? false;
|
bool obscValue = groupValue.fieldObscurityValues?[fieldKey]?[i] ?? false;
|
||||||
|
log('Doing the controller $fID with initialText $fieldValue');
|
||||||
controller(fID, initialText: fieldValue, isObscure: obscValue);
|
controller(fID, initialText: fieldValue, isObscure: obscValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -623,6 +629,7 @@ class AstromicFormController extends FormController {
|
|||||||
String fID = standeredGroupFormat((prefix != null ? '$prefix-' : '') + groupID, i.toString(), fieldKey);
|
String fID = standeredGroupFormat((prefix != null ? '$prefix-' : '') + groupID, i.toString(), fieldKey);
|
||||||
dynamic fieldValue = hve.value[i].$1;
|
dynamic fieldValue = hve.value[i].$1;
|
||||||
bool isReq = hve.value[i].$2;
|
bool isReq = hve.value[i].$2;
|
||||||
|
log('Doing the controller $fID with initial Value $fieldValue');
|
||||||
|
|
||||||
setValue(fID, fieldValue, isRequired: isReq);
|
setValue(fID, fieldValue, isRequired: isReq);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user