fromJson static method

ValueContainer fromJson(
  1. dynamic value
)

Returns a new ValueContainer instance and imports its values from value if it's a Map, null otherwise.

Implementation

// ignore: prefer_constructors_over_static_methods
static ValueContainer fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();
    return ValueContainer(
      dataTypeFlags: ValueContainerDataTypeFlagsEnum.listFromJson(json[r'DataTypeFlags']),
      dataType: ValueContainerDataTypeEnum.fromJson(json[r'DataType']),
      text: mapValueOfType<String>(json, r'Text'),
      logical: mapValueOfType<bool>(json, r'Logical'),
      date: mapDateTime(json, r'Date', ''),
      integer: mapValueOfType<int>(json, r'Integer'),
      real: mapValueOfType<double>(json, r'Real'),
    );
  }
  return null;
}