from static method

ReadWriteMarker from({
  1. required bool read,
  2. required bool write,
})

Implementation

static ReadWriteMarker from({required bool read, required bool write}) {
  if (read) {
    if (write) {
      return ReadWriteMarker.readWrite;
    }
    return ReadWriteMarker.readOnly;
  }
  if (write) {
    return ReadWriteMarker.writeOnly;
  }
  throw Exception("illegal read & write false values for this marker");
}