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.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'app.typography.gen.dart';

void main() => runApp(const ExampleApp());

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'app_typography_gen example',
      home: Scaffold(
        body: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              // The widget, built via the enum.
              const AppTypography(
                'Typography',
                style: AppTypographyStyle.titleRobotoBold,
              ),
              const SizedBox(height: 8),
              const AppTypography(
                'generated from YAML',
                style: AppTypographyStyle.titleRobotoRegular,
              ),
              const SizedBox(height: 16),
              // Or grab the raw TextStyle straight off the class.
              Text(
                'AppTypography.bodyRobotoRegular is a plain TextStyle.',
                textAlign: TextAlign.center,
                style: AppTypography.bodyRobotoRegular.copyWith(
                  color: Colors.black54,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
2
likes
160
points
38
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