match<T> method

T match<T>(
  1. T onFalse(),
  2. T onTrue()
)

Pattern matching on bool. Execute onFalse when the value is false, otherwise execute onTrue.

Same as fold.

Implementation

T match<T>(T Function() onFalse, T Function() onTrue) =>
    this ? onTrue() : onFalse();