ScopeExtension<T> extension

Scope functions for non-nullable values

on
  • T

Methods

takeIf(bool predicate(T it)) → T?

Available on T, provided by the ScopeExtension extension

Returns value if it satisfies the predicate, otherwise null Usage: number.takeIf((it) => it > 0)