$packString method Null safety

void $packString(
  1. String value
)

Implementation

void $packString(String value) {
	final Uint8List bytes = _utf8.encoder.convert(value);
	_data!.buffer.asByteData().setUint32(_offset, bytes.length, Endian.big);
	_offset += 4;
	for (int i = 0; i < bytes.length; i++) {
		_data!.buffer.asByteData().setInt8(_offset++, bytes[i]);
	}
}