hasBits<B extends BitfieldType> method

bool hasBits<B extends BitfieldType>(
  1. List<B>? bits
)

Tests that all 1 bts from all the elements of the elements in bits.

Implementation

bool hasBits<B extends BitfieldType>(List<B>? bits) {
  if (bits == null) return false;
  var testVal = 0;
  for (var item in bits) {
    if (runtimeType == item.runtimeType) {
      testVal |= item.value;
    }
  }
  return value & testVal == testVal;
}