firstNonNull<T> function
Tries a list of nullable T
s until one is not null.
Returns null if no actual value is found.
Implementation
T? firstNonNull<T>(Iterable<T?> list) {
for (final item in list) {
if (item != null) {
return item;
}
}
return null;
}