getBool method

bool getBool(
  1. int offset
)

Reads 1-byte as a boolean.

The offset must satisy the relations 0offsetoffset+1this.length.

final Buffer buffer = Buffer.fromList([1]);
final bool value = buffer.getBool(0);
print(value); // true

Implementation

bool getBool(final int offset) {
  return asByteData().getUint8(offset) != 0;
}