takeOrNull method

Iterable<T>? takeOrNull(
  1. int i
)

Returns the first n elements of the list if it is success or null

Implementation

Iterable<T>? takeOrNull(int i) =>
    match(onError: (l) => null, onSuccess: (r) => r.take(i));