Report.fromJson constructor Null safety

Report.fromJson(
  1. Map _json
)

Implementation

Report.fromJson(core.Map _json)
    : this(
        averages: _json.containsKey('averages')
            ? (_json['averages'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        headers: _json.containsKey('headers')
            ? (_json['headers'] as core.List)
                .map((value) => ReportHeaders.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        kind: _json.containsKey('kind') ? _json['kind'] as core.String : null,
        rows: _json.containsKey('rows')
            ? (_json['rows'] as core.List)
                .map((value) => (value as core.List)
                    .map((value) => value as core.String)
                    .toList())
                .toList()
            : null,
        totalMatchedRows: _json.containsKey('totalMatchedRows')
            ? _json['totalMatchedRows'] as core.String
            : null,
        totals: _json.containsKey('totals')
            ? (_json['totals'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        warnings: _json.containsKey('warnings')
            ? (_json['warnings'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
      );