generic_enum_annotation 0.1.6
generic_enum_annotation: ^0.1.6 copied to clipboard
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.