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

Simple union types using classes. Types: the union of `int` and `String` is `Union2<int, String>`. Values: `42.u21` is `42` with type `Union2<int, Never>`.

Use this package as a library

Depend on it

Run this command:

With Dart:

 $ dart pub add class_unions

With Flutter:

 $ flutter pub add class_unions

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:
  class_unions: ^1.0.0

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

Import it

Now in your Dart code, you can use:

import 'package:class_unions/class_unions.dart';
0
likes
160
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

Simple union types using classes. Types: the union of `int` and `String` is `Union2<int, String>`. Values: `42.u21` is `42` with type `Union2<int, Never>`.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on class_unions