flutter_text_helpers 2.0.0 flutter_text_helpers: ^2.0.0 copied to clipboard
A widget collection which simplifies the usage of Text() and TextField(). No need to use Theme.of(context) to access textTheme elements like bodytext1 or headline1, etc. Also provides shortcuts for co [...]
example/flutter_text_helpers_example.dart
import 'package:flutter/material.dart';
import 'package:flutter_text_helpers/flutter_text_helpers.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Text Helpers',
home: MyHome(),
theme: ThemeData(
// primarySwatch: Colors.orange,
textTheme: TextTheme(
caption: TextStyle(color: Colors.white, fontSize: 12),
subtitle1: TextStyle(color: Colors.white, fontSize: 10),
headline1: TextStyle(
color: Colors.white,
fontSize: 35,
),
headline2: TextStyle(
color: Colors.white,
fontSize: 30,
),
headline3: TextStyle(
color: Colors.white,
fontSize: 25,
),
headline4: TextStyle(
color: Colors.white,
fontSize: 15,
),
bodyText1: TextStyle(color: Colors.blue, fontSize: 12, height: 1.5),
bodyText2: TextStyle(color: Colors.black, fontSize: 12),
),
),
);
}
}
class MyHome extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
BodyText1('Default text'),
HeadlineText1('Default headline but green', color: Colors.green),
],
),
);
}
}