[SYNC]
This commit is contained in:
@@ -108,7 +108,9 @@ class AstromicFormController extends FormController {
|
|||||||
|
|
||||||
/// Get the value of a hosted state variable using it's ID.
|
/// Get the value of a hosted state variable using it's ID.
|
||||||
T? getValue<T>(String id) {
|
T? getValue<T>(String id) {
|
||||||
prepareValue(id, false);
|
if (!_hostedValues.containsKey(id)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (_hostedValues[id]?.$1 is T?) {
|
if (_hostedValues[id]?.$1 is T?) {
|
||||||
return _hostedValues[id]?.$1;
|
return _hostedValues[id]?.$1;
|
||||||
@@ -120,7 +122,8 @@ class AstromicFormController extends FormController {
|
|||||||
/// Set the value of a hosted state variable using it's ID.
|
/// Set the value of a hosted state variable using it's ID.
|
||||||
void setValue<T>(String id, T data, {bool isRequired = false}) {
|
void setValue<T>(String id, T data, {bool isRequired = false}) {
|
||||||
prepareValue(id, isRequired);
|
prepareValue(id, isRequired);
|
||||||
_hostedValues[id] = (data, isRequired);
|
//
|
||||||
|
_hostedValues[id] = (data, _hostedValues[id]!.$2);
|
||||||
_hostedValueValidationStreamController.add((id, false));
|
_hostedValueValidationStreamController.add((id, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,11 +137,6 @@ class AstromicFormController extends FormController {
|
|||||||
/// Validate hosted values.
|
/// Validate hosted values.
|
||||||
bool validateValues(List<String> valueIDs) {
|
bool validateValues(List<String> valueIDs) {
|
||||||
for (String hostedValueID in valueIDs) {
|
for (String hostedValueID in valueIDs) {
|
||||||
print('Trying to validate $hostedValueID in $_hostedValues');
|
|
||||||
print(_hostedValues.containsKey(hostedValueID));
|
|
||||||
print(_hostedValues[hostedValueID]!.$2);
|
|
||||||
print(_hostedValues[hostedValueID]!.$1);
|
|
||||||
print(_hostedValues[hostedValueID]!.$1 == null);
|
|
||||||
if (_hostedValues.containsKey(hostedValueID) && _hostedValues[hostedValueID]!.$2 && _hostedValues[hostedValueID]!.$1 == null) {
|
if (_hostedValues.containsKey(hostedValueID) && _hostedValues[hostedValueID]!.$2 && _hostedValues[hostedValueID]!.$1 == null) {
|
||||||
// Validation Error!
|
// Validation Error!
|
||||||
_hostedValueValidationStreamController.add((hostedValueID, true));
|
_hostedValueValidationStreamController.add((hostedValueID, true));
|
||||||
|
|||||||
Reference in New Issue
Block a user