What this package is like to depend on
Last release 2 years ago
no release in 18 months
Too new to tell
only 1 release windows
Rarely documented
notes for 1 of 5 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
5 releases · first in 2024
0 releases in the last 12 months
see the full history below
Release timeline
5 releases · Dec 2024 to Dec 2024
2025
2026
Releases
latest 5-
0.0.519 Dec 2024Release notes
Open source →Enum type
import 'package:algebraic_types/algebraic_types.dart'; import 'package:json/json.dart'; void main() { var w = W.Variant1(C(2)); w = W.fromJson(w.toJson()); assert(w is W$Variant1); print(w.toJson()); // {"Variant1": {"x": 2}} w = W.Variant2(C(1), B("hello")); w = W.fromJson(w.toJson()); assert(w is W$Variant2); print(w.toJson()); // {"Variant2": [{"x": 1}, {"x": hello}]} w = W.Variant3(); assert(w is W$Variant3); print(w.toJson()); // {"Variant3": null} switch (w) { case W$Variant1(:final v1): print("Variant1"); case W$Variant2(:final v1, :final v2): print("Variant2"); case W$Variant3(): print("Variant3"); } } @JsonCodable() class C { int x; C(this.x); } @JsonCodable() class B { String x; B(this.x); } // or just `@Enum` if you don't want json @EnumSerde( "Variant1(C)", "Variant2(C,B)", "Variant3" ) class _W {}
Full Changelog: https://github.com/mcmah309/algebraic_types/commits/v0.0.5
-
0.0.419 Dec 2024Nothing published for this version
-
0.0.319 Dec 2024Nothing published for this version
-
0.0.219 Dec 2024Nothing published for this version
-
0.0.117 Dec 2024Nothing published for this version