ifPresent abstract method

void ifPresent(
  1. void consume(
    1. T
    ), {
  2. void orElse(),
})

Invokes consume() with this Optional's value, if present. Otherwise, if orElse is passed, invokes it, otherwise does nothing.

Implementation

void ifPresent(void Function(T) consume, {void Function() orElse});