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

discontinued
outdated

Defines annotations processed by source code generating library generic_enum_builder.

example/README.md

Generic Enum Annotation #

Introduction #

This library defines annotations 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:

  • @GenerateValueMap(): Requests the generation of an unmodifiable map _$<ClassName>ValueMap containing the enum values and const static instances.
  • @GenerateFromJson(): Requests the generation of the private function _$<ClassName>FromJson.
  • @GenerateIdentifier(): Requests the generation of the private function _$<ClassName>Identifier. The function can be use to retrieve the identifier of each defined const generic enum instance.

Examples #

The package generic_enum_example provides a complete example on how to define and build generic enumeration classes. As a starting point users could clone this repository, add their own generic enum classes to the folder lib and build the library.

Features and #

Please file feature requests and bugs at the issue tracker.

0
likes
30
points
61
downloads

Publisher

verified publishersimphotonics.com

Weekly Downloads

Defines annotations processed by source code generating library generic_enum_builder.

License

BSD-3-Clause (license)

More

Packages that depend on generic_enum_annotation