compact<T> function Null safety

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

Implementation

List<T> compact<T>(Iterable<T?>? list) =>
    list?.whereType<T>().toList() ?? <T>[];