ifElse<T, R> static method

R Function(T) ifElse<T, R>(
  1. bool predicate(
    1. T
    ),
  2. R ifTrue(
    1. T
    ),
  3. R ifFalse(
    1. T
    )
)

Implementation

static R Function(T) ifElse<T, R>(
  bool Function(T) predicate,
  R Function(T) ifTrue,
  R Function(T) ifFalse,
) {
  return (T input) => predicate(input) ? ifTrue(input) : ifFalse(input);
}