RestResource.fromJson constructor Null safety

RestResource.fromJson(
  1. Map _json
)

Implementation

RestResource.fromJson(core.Map _json)
    : this(
        methods: _json.containsKey('methods')
            ? (_json['methods'] as core.Map<core.String, core.dynamic>).map(
                (key, item) => core.MapEntry(
                  key,
                  RestMethod.fromJson(
                      item as core.Map<core.String, core.dynamic>),
                ),
              )
            : null,
        resources: _json.containsKey('resources')
            ? (_json['resources'] as core.Map<core.String, core.dynamic>).map(
                (key, item) => core.MapEntry(
                  key,
                  RestResource.fromJson(
                      item as core.Map<core.String, core.dynamic>),
                ),
              )
            : null,
      );