Introducing Flutter Text Helpers

The ugly problem

Imagine you want to add a headline, you’d have something like this.

Text('Body text', style: Theme.of(context).textTheme.headline1)
Text('Body text', style: Theme.of(context).textTheme.bodyText.copyWith(color: Colors.blue))

How to solve that?

Well, one solution might be to create stateless Widgets for each and every piece of custom formatted text like GreenHeadline(‘some text’), GreenHeadlineBigger(‘Bigger text’), and so on.

Meet flutter_text_helpers!

The plugin offers shortcuts for rendering different styles of text-widgets while still allowing to add “ad-hoc” modifications, which are more readable.

HeadlineText1('Some headline!', color: Colors.blue, fontSize: 30),
Text('Some headline!', style: Theme.of(context).textTheme.headline1.copyWith(color: Colors.blue, fontSize: 12))
HeadlineText1('Some headline!', overflow: TextOverflow.ellipsis)

Where to find?

You can find it on pub.dev https://pub.dev/packages/flutter_text_helpers

Hope you enjoy it!

Cheers!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adis Durakovic

Adis Durakovic

41 Followers

Digital Entrepreneur & Developer. Based in Vienna/Austria.