sealed_unions 1.0.0 copy "sealed_unions: ^1.0.0" to clipboard
sealed_unions: ^1.0.0 copied to clipboard

outdatedDart 1 only

Sealed Unions for Dart

dart_sealed_unions #

ACKNOWLEDGEMENTS #

This library is a port of JavaSealedUnions originally created by Francisco (Paco) Estévez .

Dart port by George Medve with assistance from Jan Knotek.

This read me file will be elaborated in due course.

DISTRIBUTION #

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

RATIONALE #

Sealed classes are used for representing restricted class hierarchies, when a value can have one of the types from a limited set, but cannot have any other type. They are, in a sense, an extension of enum classes: the set of values for an enum type is also restricted, but each enum constant exists only as a single instance, whereas a subclass of a sealed class can have multiple instances which can contain state. Sealed classes are available in Kotlin Sealed Classes and the idea being ported to Java (mentioned above). The lack of and the usefulness of these classes prompted us to create a Dart implemenation.

dependencies:
  sealed_unions: "^1.0.0"

You can install packages from the command line:

with pub:

pub get

with Flutter:

flutter packages get

License #

Copyright (c) flutterconsortium 2018

The Apache Software License, Version 2.0

See LICENSE.md