firstOrNull<V> function

V? firstOrNull<V>(
  1. Iterable<V> list
)

Returns first element in array, if it's empty returns null.

Implementation

V? firstOrNull<V>(Iterable<V> list) {
  if (list.isEmpty) return null;
  return list.first;
}