listing property Null safety

List<String> listing

Implementation

List<String> get listing {
  final r = List<String>.empty(growable: true);
  r.add('   000 {          } ');
  for (int i = 1; i <= lines; i++) {
    String line = i.toString().padLeft(3, '0');
    final ProgramInstruction<OT> pi = this[i];
    final String pd = this[i].programDisplay;
    String semiHuman =
        pd.substring(1).replaceAll(',', ' ').replaceAll('  .', ' .');
    if (pd.startsWith('u')) {
      semiHuman = '$semiHuman u';
    }
    semiHuman = semiHuman.padLeft(8);
    assert(semiHuman.length == 8, '"$semiHuman" from $pd'); // and no longer
    String human = pi.programListing;
    r.add('   $line { $semiHuman } $human');
  }
  return r;
}