mantle_gen 1.1.0 copy "mantle_gen: ^1.1.0" to clipboard
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.

0
likes
160
points
100
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

build_runner generators for Mantle. Annotate token groups and components, then emit helpers with SharedPartBuilder.

Homepage
Repository (GitHub)
View/report issues

Topics

#codegen #build-runner #design-system #theme #flutter

License

MIT (license)

Dependencies

analyzer, build, mantle_annotations, source_gen

More

Packages that depend on mantle_gen