indexWhereOrNull method

int? indexWhereOrNull(
  1. Predicate<E> test, [
  2. int start = 0
])

same behavior as indexWhere but it is null safe which means it do nothing when List return isEmptyOrNull to true.

Implementation

int? indexWhereOrNull(Predicate<E> test, [int start = 0]) {
  if (isEmptyOrNull) return null;
  try {
    return this!.indexWhere(test, start);
  } catch (e, s) {
    dev.log('$e', stackTrace: s);
    return null;
  }
}