putBool method

void putBool(
  1. bool value
)

Writes a bool to the tail of the buffer after preparing space for it. Bools are represented as a Uint8, with the value set to '1' for true, and '0' for false

Updates the offset pointer. This method is intended for use when writing structs to the buffer.

Implementation

void putBool(bool value) {
  _prepare(_sizeofUint8, 1);
  _buf.setInt8(_buf.lengthInBytes - _tail, value ? 1 : 0);
}