firstOrNull property
T?
firstOrNull
Returns the first element.
Return null
if the list has no element.
Implementation
T? get firstOrNull {
if (this == null || isEmpty) {
return null;
}
return this?.first;
}