otherwise method

ClosedPatternMatcher<I, O> otherwise(
  1. O function(
    1. I input
    )
)

Implementation

ClosedPatternMatcher<I, O> otherwise(O Function(I input) function) {
  var newCases = List<_Case<I, dynamic, O>>.from(_cases);
  newCases.add(
      _Case(predicate((i) => true, (i) async => i, 'Otherwise'), identity));
  return ClosedPatternMatcher(newCases);
}