firstWhereOrNull method
Returns first element by given predicate or null otherwise
Implementation
T? firstWhereOrNull(bool Function(T element) test) {
if (this == null) return null;
final list = this!.where(test);
return list.isEmpty ? null : list.first;
}