takeIf method

T? takeIf(
  1. bool condition(
    1. T it
    )
)

Implementation

T? takeIf(final bool Function(T it) condition) =>
    condition.call(this) ? this : null;