Last updated:
0 purchases
instant text styles
Features #
Simple text styles can be implemented instantly.
Used Material Design3 Typography.
-> https://m3.material.io/styles/typography/type-scale-tokens
Basic Properties:
display
headline
title
body
caption
button
overline
Getting started #
In your flutter project add the dependency:
dependencies:
instant_text_styles: ^<version>
copied to clipboard
Import package:
import 'package:instant_text_styles/instant_text_styles.dart';
copied to clipboard
Usage #
The simplest example:
Text('Title Large', style: TextStyles.title.large),
copied to clipboard
Example of changing colors:
Text('Title Large Black', style: TextStyles.title.black),
Text('Title Large White', style: TextStyles.title.white),
copied to clipboard
Example of changing color according to status:
//Color(0xFF34C759)
Text('Success!!', style: TextStyles.body.success),
//Color(0xFFFF3B30)
Text('Error!!', style: TextStyles.body.error),
//Color(0xFFFF9500)
Text('Warning!!', style: TextStyles.body.warning),
copied to clipboard
Example of text decoration:
// Draw a line underneath each line of text
Text('Underline', style: TextStyles.body.underline),
// Draw a line through each line of text
Text('LineThrough', style: TextStyles.body.lineThrough),
// Draw a line above each line of text
Text('Overline', style: TextStyles.body.overline),
copied to clipboard
If you want to adjust parameters:
Text('Use copyWith', style: TextStyles.body.copyWith(color: Colors.amber)),
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.