app_typography_gen 0.1.0 copy "app_typography_gen: ^0.1.0" to clipboard
app_typography_gen: ^0.1.0 copied to clipboard

Generate a typed Text widget, style enum, and text styles for Flutter from a single well-structured YAML typography config.

0.1.0 #

First release.

Describe your text styles once in YAML - grouped by font family, each one named and given a size (plus optional line_height, tracking and weight) - and the generator writes an AppTypographyStyle enum, the TextStyles, and an AppTypography Text wrapper that applies them. You pick the names, so they match whatever your design system already calls them, and only the fields you set show up in the generated TextStyle.

Two knobs control the output:

  • style_access - where the styles live: getters on a TextTheme extension, static const fields on a separate class, or static const fields on the widget itself, so AppTypography.titleRobotoBold is the TextStyle.
  • call_site - how you build the widget: a named constructor per style (AppTypography.titleRobotoBold('Hi')) or one constructor that takes the style (AppTypography('Hi', style: AppTypographyStyle.titleRobotoBold)).

Run it with build_runner (.typography.yaml -> .typography.gen.dart) or the app_typography_gen CLI, which can also read the config straight from pubspec.yaml.

2
likes
160
points
37
downloads

Documentation

API reference

Publisher

verified publisherhotshotslabs.com

Weekly Downloads

Generate a typed Text widget, style enum, and text styles for Flutter from a single well-structured YAML typography config.

Repository (GitHub)
View/report issues

Topics

#codegen #build-runner #typography #flutter #theming

License

MIT (license)

Dependencies

build, dart_style, yaml

More

Packages that depend on app_typography_gen