fromMap static method

JsonValue? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static JsonValue? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  switch (_) {
    case 'jsonValueObject':
      return JsonValueObject.fromMap(_map);
    case 'jsonValueArray':
      return JsonValueArray.fromMap(_map);
    case 'jsonValueBoolean':
      return JsonValueBoolean.fromMap(_map);
    case 'jsonValueNumber':
      return JsonValueNumber.fromMap(_map);
    case 'jsonValueString':
      return JsonValueString.fromMap(_map);
    case 'jsonValueNull':
      return JsonValueNull.fromMap(_map);
    case null:
    default:
      return null;
  }
}