unwrapOr method
Returns the present value, or fallback when this option is absent.
final count = const None<int>().unwrapOr(0);
final existing = const Some<int>(7).unwrapOr(0);
Implementation
@override
T unwrapOr(T fallback) => value;
Returns the present value, or fallback when this option is absent.
final count = const None<int>().unwrapOr(0);
final existing = const Some<int>(7).unwrapOr(0);
@override
T unwrapOr(T fallback) => value;