toJson method Null safety

Map<String, Object> toJson()

Implementation

Map<String, Object> toJson() {
  final st = StringBuffer();
  for (int i = 0; i < totalNybbles; i++) {
    st.write(storage.getUint8(i).toRadixString(16));
  }
  final r = <String, Object>{
    'storage': st.toString(),
    'program': program.toJson(),
    'I': registers._indexValue.toJson()
  };
  return r;
}