Optional.dart is an implementation of the
Optional type, inspired by Java 8's Optional class.
Optional.empty()constructor is now
Presentare now subclasses of
Optional. You should continue to use constructors in
Optional, and not the
EMPTYis now a top-level constant.
Optional.empty()constructors are now
Optional.of()constructor now throws
ArgumentErrorwhen passed null, instead of
Add this to your package's pubspec.yaml file:
dependencies: optional: ^2.0.1+2
You can install packages from the command line:
$ pub get
Alternatively, your editor might support
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|3.0.2||Apr 29, 2019|
|3.0.1||Mar 18, 2019|
|3.0.0+2||Aug 9, 2018|
|3.0.0+1||Jul 30, 2018|
|3.0.0||Jul 30, 2018|
|2.0.2||Jun 26, 2018|
|2.0.1+2||Jun 6, 2018|
|2.0.1+1||Jun 6, 2018|
|2.0.1||Jun 6, 2018|
|2.0.0||Jun 6, 2018|
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.
Support Dart 2 in
The SDK constraint in
pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://dart.dev/dart-2#migration.
dartdoc successfully runs on your package's source files. (-10 points)
Dependencies were not resolved.