boolean static method

BcsType<bool, dynamic> boolean([
  1. BcsTypeOptions<bool, bool>? options
])

Implementation

static BcsType<bool,dynamic> boolean([BcsTypeOptions<bool,bool>? options]) {
  return fixedSizeBcsType<bool,dynamic>(
    name: 'Bool',
    size: 1,
    read: (reader) => reader.read8() == 1,
    write: (value, writer) => writer.write8(value ? 1 : 0),
    validate: (value) {
      options?.validate?.call(value);
    },
  );
}