read static method

AsTranslation? read(
  1. BinaryReader reader
)

Implementation

static AsTranslation? read(BinaryReader reader) {
  if (reader.isEOF) {
    return null;
  }
  final ok = reader.readUint8() != 0;
  final source = reader.readString();
  final notes = <AsTranslationNote>[];
  final count = reader.readVarUint();
  for (int i = 0; i < count; i++) {
    final line = reader.readVarUint();
    final column = reader.readVarUint();
    // 2 is a warning, which still ports.
    final fatal = reader.readUint8() == 1;
    notes.add(
      AsTranslationNote(
        line: line,
        column: column,
        fatal: fatal,
        message: reader.readString(),
      ),
    );
  }
  return AsTranslation(ok: ok, source: source, notes: notes);
}