filterNotNull method

  1. @useResult
KtList<T> filterNotNull()

Returns a list containing all elements that are not null.

Implementation

@useResult
KtList<T> filterNotNull() {
  final list = filterNotNullTo(mutableListOf<T>());
  // TODO ping dart-lang/sdk team to check type bug
  // When in single line: type "DartMutableList<String>' is not a subtype of type 'Null"
  return list;
}