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();
    final fatal = reader.readUint8() != 0;
    notes.add(AsTranslationNote(
      line: line,
      column: column,
      fatal: fatal,
      message: reader.readString(),
    ));
  }
  return AsTranslation(ok: ok, source: source, notes: notes);
}