indexOfGE<T extends Comparable<T>> function

  1. @Deprecated('Use List extension methods')
int? indexOfGE<T extends Comparable<T>>(
  1. List<T> a,
  2. T x, {
  3. bool dontPanic = false,
})

Locate leftmost item greater than or equal to x

Implementation

@Deprecated('Use List extension methods') // since 2021-11
int? indexOfGE<T extends Comparable<T>>(List<T> a, T x,
    {bool dontPanic = false}) {
  final i = bisect_left(a, x);
  if (i != a.length) return i;

  if (dontPanic) {
    return null;
  } else {
    throw ItemNotFoundError();
  }
}