nullFilteredSet<T> function

Set<T> nullFilteredSet<T>(
  1. Iterable input
)

Converts input to a Set with non-null elements if T is non-null.

Implementation

Set<T> nullFilteredSet<T>(Iterable<dynamic> input) {
  final filtered = input.toSet()..retainWhere((e) => (null is T || e != null));
  return filtered.cast();
}