flutter_text_helpers 2.0.5 copy "flutter_text_helpers: ^2.0.5" to clipboard
flutter_text_helpers: ^2.0.5 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),
        ],
      ),
    );
  }
}
3
likes
30
pub points
0%
popularity

Publisher

unverified uploader

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 color and fontSize.

Repository (GitLab)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_text_helpers