indexOfOrNull method
same behavior as indexOf but it is null safe which means
it do nothing when List return isEmptyOrNull
to true.
Implementation
int? indexOfOrNull(E? element) =>
isEmptyOrNull || element == null ? null : this!.indexOf(element);