plain_optional 0.1.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 83


plain_optional #

plain_optional package defines a type Optional<T> containing an object of type T, optionally. Similar to Optional<T> in Swift.

0.1.3 #

  • Fix map, flatMap, hashCode.

0.1.2 #

  • Add unsafe getter.

0.1.1+1 #

  • Update the package description.

0.1.1 #

  • Add two- and three-argument map and flat-map functions.

0.1.0 #

  • A basic implementation of Optional<T> in Dart.


Example #

A plain_optional package usage example.

Running #

With Dart SDK #

As usual, run pub get first, then pub run example:main.

With Flutter SDK #

As usual, run flutter pub get first, then flutter pub run example:main.

Use this package as a library

1. Depend on it

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

  plain_optional: ^0.1.3

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:plain_optional/plain_optional.dart';
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]
Learn more about scoring.

We analyzed this package on Mar 30, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.5.0 <3.0.0
meta ^1.1.0 1.1.8
Dev dependencies
test ^1.6.0