toSet<T> static method

Set<T>? toSet<T>(
  1. List<T> list
)

Converts a list to a set.

Example: 1, 2, 3 -> {1, 2, 3}

Implementation

static Set<T>? toSet<T>(List<T> list) =>
    list.isNotEmpty ? Set.from(list) : null;