andThen<U> abstract method

  1. @useResult
Option<U> andThen<U>(
  1. Option<U> calculateOther(
    1. T value
    )
)

Returns the result of calculateOther if this is a Some, or None otherwise.

Examples

// prints "Some(3)"
print(const Some(2).andThen((value) => const Some(3)));

// prints "None"
print(const None<int>().andThen((value) => const Some(3)));

Implementation

@useResult
Option<U> andThen<U>(Option<U> Function(T value) calculateOther);