andThen<U> method

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

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

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