decodeJson method Null safety
override
Convert from a data structure that comes from JSON. If there's an error in the middle, it might be partially read, but not in a way that causes bad behavior in the calculator.
Implementation
@override
void decodeJson(Map<String, dynamic> json, {required bool needsSave}) {
super.decodeJson(json, needsSave: needsSave);
memory.numRegisters = json['numRegisters'] as int;
resultMatrix = json['resultMatrix'] as int;
isComplexMode = getFlag(8);
final ms = json['matrices'] as List;
for (int i = 0; i < matrices.length; i++) {
matrices[i].decodeJson(ms[i] as Map<String, dynamic>);
}
final Object? lastRandom = json['lastRandom'];
if (lastRandom is double) {
rand.setNoReseed(lastRandom);
}
}