flutter_design_annotation
Used by the code generator to create catalog to show in the design system viewer.
Annotations will be used by flutter_design_codegen
to generate catalog classes which populates the viewer catalog shown in flutter_design_viewer
.
@Design
@Design
The @Design
annotation could be used on classes and factory constructors to generated catalog code in accompanying .catalog.dart
file which is then consumed by the design system viewer.
This is considered an inline catalog declaration which is very useful for components. For more complicated catalogs, the user should create it in separate catalog files.
Here is a minimal example of using @design
on a Widget declaration to create a Primary component:
Powered by source_gen and build_runner the flutter_design_codegen
package will generate a catalog for you that could be directly used in the flutter_design_viewer
.
Here is a fully customized example of using @Design
:
(TBD) Similarly, you can also use the @Design
annotation on a factory constructor which will create Secondary component(s).
Last updated