generic_enum_builder 0.1.9 generic_enum_builder: ^0.1.9 copied to clipboard
Source code generator processing annotated generic_enum classes. Generates a value-instance map and a json-serialization function.
Generic Enum Builder #
Introduction #
GenericEnumBuilder contains source code generating classes based on source_gen and analyzer.
The provided builders can be configured to build GenericEnum classes supporting json-serialization.
Generic enumeration classes appear to the user like a Dart enum
would.
For example, generic enums can be used in switch
statements, as annotations,
to initialize variables, or as default parameters in functions and constructors.
Usage #
To use this library include generic_enum and generic_enum_annotation as dependencies in your pubspec.yaml
file.
Include generic_enum_builder, source_gen, and build_runner as dev_dependencies.
A step-by-step guide on how to build a generic enumeration is provided here.
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 bugs #
Please file feature requests and bugs at the issue tracker.