compact<T> static method

List<T> compact<T>(
  1. Iterable<T>? list
)

Implementation

static List<T> compact<T>(Iterable<T>? list) =>
    list?.where((item) => item != null).toList() ?? <T>[];