optional 2.0.1 optional: ^2.0.1 copied to clipboard
An implementation of the Optional type
Changelog #
2.0.0 #
- Compatibility with Dart 2
1.2.3 #
- Add an optional
orElse
parameter toifPresent
.
1.2.2 #
Optional.empty()
constructor is nowconst
.
1.2.1 #
Absent
andPresent
are now subclasses ofOptional
. You should continue to use constructors inOptional
, and not theAbsent
orPresent
ones.EMPTY
is now a top-level constant.
1.2.0 #
- Operators are now overloaded, so you can add, subtract, etc., Optionals. Any operation involving an empty Optional will return an empty Optional.
- Added examples.
1.1.0 #
Optional.ofNullable()
andOptional.empty()
constructors are nowconst
.Optional.of()
constructor now throwsArgumentError
when passed null, instead ofNoValuePresentError
.NoValuePresentError
now extendsStateError
.
1.0.0 #
- Initial release