optional 1.2.3+1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • --

Optional.dart #

Optional.dart is an implementation of the Optional type, inspired by Java 8's Optional class.

Changelog #

1.2.3 #

  • Add an optional orElse parameter to ifPresent.

1.2.2 #

  • Optional.empty() constructor is now const.

1.2.1 #

  • Absent and Present are now subclasses of Optional. You should continue to use constructors in Optional, and not the Absent or Present 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() and Optional.empty() constructors are now const.
  • Optional.of() constructor now throws ArgumentError when passed null, instead of NoValuePresentError.
  • NoValuePresentError now extends StateError.

1.0.0 #

  • Initial release

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  optional: ^1.2.3+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:optional/optional.dart';
  
Version Uploaded Documentation Archive
3.0.2 Apr 29, 2019 Go to the documentation of optional 3.0.2 Download optional 3.0.2 archive
3.0.1 Mar 18, 2019 Go to the documentation of optional 3.0.1 Download optional 3.0.1 archive
3.0.0+2 Aug 9, 2018 Go to the documentation of optional 3.0.0+2 Download optional 3.0.0+2 archive
3.0.0+1 Jul 30, 2018 Go to the documentation of optional 3.0.0+1 Download optional 3.0.0+1 archive
3.0.0 Jul 30, 2018 Go to the documentation of optional 3.0.0 Download optional 3.0.0 archive
2.0.2 Jun 26, 2018 Go to the documentation of optional 2.0.2 Download optional 2.0.2 archive
2.0.1+2 Jun 6, 2018 Go to the documentation of optional 2.0.1+2 Download optional 2.0.1+2 archive
2.0.1+1 Jun 6, 2018 Go to the documentation of optional 2.0.1+1 Download optional 2.0.1+1 archive
2.0.1 Jun 6, 2018 Go to the documentation of optional 2.0.1 Download optional 2.0.1 archive
2.0.0 Jun 6, 2018 Go to the documentation of optional 2.0.0 Download optional 2.0.0 archive

All 21 versions...

Awaiting analysis to complete.