noneIfEmpty property

Option<List<T>> get noneIfEmpty

Returns this list wrapped in a Some if it's not empty, otherwise returns None.

Implementation

Option<List<T>> get noneIfEmpty => isEmpty ? const None() : Some(this);