getByIndex static method
FloatLength.values indexed by position, throwing CborException
for an out-of-range index rather than the default RangeError.
Implementation
static FloatLength getByIndex(int index) {
try {
final v = values.elementAtOrNull(index);
if (v != null) {
return v;
}
} catch (_) {}
throw BuError(
DefaultErrorType.invalidLength,
"Invalid float length index.",
);
}