Type.fromJson constructor

Type.fromJson(
  1. Map json_
)

Implementation

Type.fromJson(core.Map json_)
    : this(
        edition: json_.containsKey('edition')
            ? json_['edition'] as core.String
            : null,
        fields: json_.containsKey('fields')
            ? (json_['fields'] as core.List)
                .map((value) => Field.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        name: json_.containsKey('name') ? json_['name'] as core.String : null,
        oneofs: json_.containsKey('oneofs')
            ? (json_['oneofs'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        options: json_.containsKey('options')
            ? (json_['options'] as core.List)
                .map((value) => Option.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        sourceContext: json_.containsKey('sourceContext')
            ? SourceContext.fromJson(
                json_['sourceContext'] as core.Map<core.String, core.dynamic>)
            : null,
        syntax: json_.containsKey('syntax')
            ? json_['syntax'] as core.String
            : null,
      );