decodeJson method Null safety

void decodeJson(
  1. Map<String, dynamic> m
)

Implementation

void decodeJson(Map<String, dynamic> m) {
  final rsRaw = m['rowSwaps'] as List?;
  if (rsRaw == null) {
    _rowSwaps = null;
  } else {
    _rowSwaps =
        List.generate(rsRaw.length, (i) => rsRaw[i] as int, growable: false);
  }
  _columns = m['columns'] as int;
  final v = m['values'] as List;
  _values = List.generate(v.length, (i) => Value.fromJson(v[i] as String),
      growable: false);
}