generic_enum_annotation 0.0.4 copy "generic_enum_annotation: ^0.0.4" to clipboard
generic_enum_annotation: ^0.0.4 copied to clipboard

discontinued
outdated

Defines annotations processed by source code generating library generic_enum_generator.

example/README.md

Generic Enum Annotation #

Introduction #

This library defines annotation classes (with const constructor). These are used to annotate classes that extend GenericEnum.

GenericEnum is a base class for creating generic classes with a fixed set of static constant instances. These classes appear to the user like a Dart enum would. For example, generic enums can be used in switch statements, to initialize variables, or as default parameters in functions and constructors.

The annotations defined in this library are:

  • @GenerateMap(): Requests the generation of a BuiltMap containing the enum values and instances.
  • @GenerateJson(): Requests the generation of the methods _toJson and fromJson

Important: @GenerateJson() requires @GenerateMap() since the fromJson function uses the BuiltMap to retrieve generic enum instances based on their value.

Examples #

For examples on how to use generic_enum_annotation to annotate and build generic enums see: example.dart

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0
likes
0
pub points
0%
popularity

Publisher

verified publishersimphotonics.com

Defines annotations processed by source code generating library generic_enum_generator.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on generic_enum_annotation