isNotNull<T> function

bool isNotNull<T>(
  1. T? x
)

Tests whether the given argument x is not null.

Useful as a predicate for filter-type higher-order functions.

['a', null, 'c', null, 'd'].where(isNotNull) // ['a', 'c', 'd']

Implementation

bool isNotNull<T>(T? x) => x != null;