indexOrNull method
The first index in the list that satisfies the provided test
or null.
Implementation
int? indexOrNull(bool Function(T? element) test) {
final index = indexWhere(test);
if (index == -1) {
return null;
}
return index;
}