convertFlags method

  1. @visibleForTesting
int convertFlags(
  1. List<int> flags
)

This method is just visible for unit testing and should not be relied on. Its method signature may change at any time.

Implementation

@visibleForTesting
int convertFlags(List<int> flags) {
  var finalValue = 0;
  for (var i = 0; i < flags.length; i++) {
    if (!_isPowerOfTwo(flags[i])) {
      throw ArgumentError.value(flags[i], 'flag\'s value must be power of 2');
    }
    finalValue |= flags[i];
  }
  return finalValue;
}