findIndex function

  1. @Deprecated("Use inbuilt List.indexOf() or List.indexWhere() instead")
int findIndex(
  1. List list,
  2. dynamic predicate, {
  3. int fromIndex = 0,
})

Implementation

@Deprecated("Use inbuilt List.indexOf() or List.indexWhere() instead")
int findIndex(List list, dynamic predicate, {int fromIndex = 0}) {
  for (int i = fromIndex; i < list.length; i++) {
    if (evaluatePredicate(predicate, list[i])) return i;
  }
  return -1;
}