head method

E? head()

Returns the first element.

Similar to .first, but returns null if there are no elements instead of throwing exception.

Implementation

E? head() {
  return h.headList(this);
}