fromInt static method

Convert an integer with bitwise representations to a list of enum values.

Implementation

static List<BleCharacteristicPermission> fromInt(int value) {
  final List<BleCharacteristicPermission> permissionsList = [];

  for (final BleCharacteristicPermission permission
      in BleCharacteristicPermission.values) {
    if ((value & permission.value) != 0) {
      permissionsList.add(permission);
    }
  }
  return permissionsList;
}