toList method

List<T> toList()

convert optional value into list of length 0 or 1.

Implementation

List<T> toList() => this == null ? [] : [this!];