Value.fromJson constructor

Value.fromJson(
  1. Object? j
)

Implementation

factory Value.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Value(
    nullValue: switch ((json.containsKey('nullValue'), json['nullValue'])) {
      (false, _) => null,
      (true, Object? $1) => NullValue.fromJson($1),
    },
    booleanValue: switch (json['booleanValue']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    integerValue: switch (json['integerValue']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
    doubleValue: switch (json['doubleValue']) {
      null => null,
      Object $1 => decodeDouble($1),
    },
    timestampValue: switch (json['timestampValue']) {
      null => null,
      Object $1 => Timestamp.fromJson($1),
    },
    stringValue: switch (json['stringValue']) {
      null => null,
      Object $1 => decodeString($1),
    },
    bytesValue: switch (json['bytesValue']) {
      null => null,
      Object $1 => decodeBytes($1),
    },
    referenceValue: switch (json['referenceValue']) {
      null => null,
      Object $1 => decodeString($1),
    },
    geoPointValue: switch (json['geoPointValue']) {
      null => null,
      Object $1 => LatLng.fromJson($1),
    },
    arrayValue: switch (json['arrayValue']) {
      null => null,
      Object $1 => ArrayValue.fromJson($1),
    },
    mapValue: switch (json['mapValue']) {
      null => null,
      Object $1 => MapValue.fromJson($1),
    },
    fieldReferenceValue: switch (json['fieldReferenceValue']) {
      null => null,
      Object $1 => decodeString($1),
    },
    variableReferenceValue: switch (json['variableReferenceValue']) {
      null => null,
      Object $1 => decodeString($1),
    },
    functionValue: switch (json['functionValue']) {
      null => null,
      Object $1 => Function$.fromJson($1),
    },
    pipelineValue: switch (json['pipelineValue']) {
      null => null,
      Object $1 => Pipeline.fromJson($1),
    },
  );
}