app_typography_gen 0.1.0
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 aTextThemeextension,static constfields on a separate class, orstatic constfields on the widget itself, soAppTypography.titleRobotoBoldis theTextStyle.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.