toJson method Null safety

  1. @override
Map<String, Object> toJson()
override

Convert to a data structure that can be serialized as JSON.

Implementation

@override
Map<String, Object> toJson() {
  final r = super.toJson();
  r['numRegisters'] = memory.numRegisters;
  r['resultMatrix'] = resultMatrix;
  r['matrices'] = List.generate(matrices.length, (i) => matrices[i].toJson(),
      growable: false);
  r['lastRandom'] = rand.lastValue;
  return r;
}