flutter_text_helpers 1.0.1
flutter_text_helpers: ^1.0.1

Flutter Android iOS web

A widget collection which simplifies the usage of Text(). No need to use Theme.of(context) to access textTheme elements like bodytext1 or headline1, etc.

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),
        ],
      ),
    );
  }
}
1
likes
100
pub points
37%
popularity

A widget collection which simplifies the usage of Text(). No need to use Theme.of(context) to access textTheme elements like bodytext1 or headline1, etc.

Repository (GitLab)
View/report issues

Documentation

API reference

Uploader

adis.durakovic@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_text_helpers