string method Null safety

String string(
  1. int length
)

Reads a string of the given length from the buffer.

Implementation

String string(int length) {
  String s = utf8.decode(data.sublist(_readPos, _readPos + length));
  _readPos += length;
  return s;
}