toList method

  1. @override
List<T> toList({
  1. bool growable = true,
  2. int compare(
    1. T a,
    2. T b
    )?,
})
override

Returns a List with all items from the set.

If you provide a compare function, the list will be sorted with it.

Implementation

@override
List<T> toList({
  bool growable = true,
  int Function(T a, T b)? compare,
}) {
  if (config.sort && compare == null) {
    return (flush._s as SFlat<T>).toList(growable: growable);
  } else {
    var result = _s.toList(growable: growable);
    if (compare != null) result.sort(compare);
    return result;
  }
}