indexWhere static method

int indexWhere(
  1. List list,
  2. bool condition(
    1. dynamic
    ), {
  3. bool needReset = false,
})

查找索引

Implementation

static int indexWhere(List list, bool Function(dynamic) condition, {bool needReset = false}) {
  int index = list.indexWhere(condition);
  if (needReset) {
    index = index == -1 ? 0 : index;
  }
  return index;
}