Source.fromJson constructor

Source.fromJson(
  1. Map _json
)

Implementation

Source.fromJson(core.Map _json)
    : this(
        baseSpecs: _json.containsKey('baseSpecs')
            ? (_json['baseSpecs'] as core.List)
                .map<core.Map<core.String, core.Object>>((value) =>
                    (value as core.Map<core.String, core.dynamic>).map(
                      (key, item) => core.MapEntry(
                        key,
                        item as core.Object,
                      ),
                    ))
                .toList()
            : null,
        codec: _json.containsKey('codec')
            ? (_json['codec'] as core.Map<core.String, core.dynamic>).map(
                (key, item) => core.MapEntry(
                  key,
                  item as core.Object,
                ),
              )
            : null,
        doesNotNeedSplitting: _json.containsKey('doesNotNeedSplitting')
            ? _json['doesNotNeedSplitting'] as core.bool
            : null,
        metadata: _json.containsKey('metadata')
            ? SourceMetadata.fromJson(
                _json['metadata'] as core.Map<core.String, core.dynamic>)
            : null,
        spec: _json.containsKey('spec')
            ? (_json['spec'] as core.Map<core.String, core.dynamic>).map(
                (key, item) => core.MapEntry(
                  key,
                  item as core.Object,
                ),
              )
            : null,
      );