mantle_gen 1.1.0
mantle_gen: ^1.1.0 copied to clipboard
build_runner generators for Mantle. Annotate token groups and components, then emit helpers with SharedPartBuilder.
mantle_gen #
build_runner generators for Mantle.
Annotate libraries with mantle_annotations;
this package emits the matching part files. Add it as a dev dependency only
— app code never imports mantle_gen directly.
Install #
dependencies:
mantle_annotations: ^1.1.0
dev_dependencies:
mantle_gen: ^1.1.0
build_runner: ^2.4.0
See example/example.dart for sample generator input.
Then:
dart run build_runner build --delete-conflicting-outputs
Builders #
Configured in this package's build.yaml and applied automatically to
dependents:
| Builder | Annotation | Output |
|---|---|---|
mantle_token |
@MantleToken |
Shared part (.mantle.g.part → combined .g.dart) |
Token generator #
Size-list @MantleToken classes emit _$ClassName (named fields, all.md,
merge/lerp). @MantleAppTheme emits AppTheme.of(context).
Static-const classes still get toMap().
License #
MIT. See LICENSE.