Skip to content

glebosotov/flutter_regex_text_style

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

regex_text_style

This package will help you to apply TextStyles to a String and render them in RichText based on regex mathes. For example, you can make all the digits in your text bold and all letters l very big with the following example.

RegexTextStyle(
    text: 'Hello world 123',
    styles: [
        RegexStyle(r'\d', TextStyle(fontWeight: FontWeight.bold)),
        RegexStyle(r'l', TextStyle(fontSize: 100)),
    ],
     style: const TextStyle()
)

example

Getting started

  • import the library
  • create a RegexTextStyle widget, provide the text, styles and a default style as in example above
  • order of styles dictates how they will apply/collide

Additional information

Contact me via GitHub issues or Telegram

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages