oneOfLengths static method
void
oneOfLengths(})
Requires data length to be one of allowed, throws BuError otherwise.
Implementation
static void oneOfLengths(
List<int> data,
List<int> allowed, {
required String operation,
required String name,
}) {
if (!allowed.contains(data.length)) {
throw CoreErrors.invalidOperationArguments(
operation,
name: name,
reason: 'length ${data.length} not in $allowed',
details: {'actual': '${data.length}', 'allowed': '$allowed'},
);
}
}