text_style 0.0.2 copy "text_style: ^0.0.2" to clipboard
text_style: ^0.0.2 copied to clipboard

A minimal Flutter package for quickly applying TextStyle with shorthand.

๐ŸŽจ text_style #

A simple and expressive way to manage and reuse TextStyles in your Flutter apps.

With text_style, you can define a consistent typography system using shorthand syntax like:

Text('Hello', style: T.s16w700.white);

โœจ Features #

  • Shorthand TextStyle syntax (e.g. T.s14w400.primary)
  • Built-in extension methods for commonly used colors
  • responsive fonts size
  • Support for dynamic primary color
  • Flexible and clean structure for typography management
  • Works out of the box โ€“ no setup required!

๐Ÿš€ Getting Started #

1. Install the package #

Add to your pubspec.yaml:

dependencies:
  text_style: ^0.0.2

Then run:

flutter pub get

2. Usage #

import 'package:text_style/text_style.dart';

Text(
  'Welcome!',
  style: T.s20w700.primary,
);

You can also use extensions for color:

Text(
  'White Text',
  style: T.s16w400.white,
);

Set the primary color globally:

TextStyleConfig.primaryColor = Colors.deepPurple;

๐Ÿ’ก Best Practices #

  • Use T.s14w400.primary to maintain consistency across your app.
  • Use extensions like .white, .black, .primary to simplify styling.
  • Inject your theme's primary color once at the app level.

๐Ÿงช Example #

Check the example/text_style_example.dart folder for a full working demo.


๐Ÿ“„ License #

This package is released under the MIT License.
See LICENSE for details.


โค๏ธ Contributions #

Contributions, issues, and feature requests are welcome!
Feel free to open a pull request or an issue.


๐Ÿ“ซ Contact #

For any questions or ideas, feel free to reach out!

1
likes
140
points
202
downloads

Publisher

unverified uploader

Weekly Downloads

A minimal Flutter package for quickly applying TextStyle with shorthand.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_screenutil

More

Packages that depend on text_style