getByIndex static method

FloatLength getByIndex(
  1. int index
)

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.",
  );
}