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.
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,
),
),
],
),
),
),
);
}
}