forEach<E> static method

void forEach<E>(
  1. Iterable<Maybe<E>>? maybeIterable,
  2. void f(
    1. E element
    )
)

Implementation

static void forEach<E>(
  Iterable<Maybe<E>>? maybeIterable,
  void Function(E element) f,
) {
  if (maybeIterable == null) {
    maybeIterable
        ?.where((v) => !v._isNothing)
        .map((v) => v._value)
        .forEach((element) {
      f(element!);
    });
  }
}