Skip to content

GiacomoPignoni/very_rich_text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

very_rich_text

A Flutter widget to make RichText Widget more useful.
Give to it some settings and a text with some markup and it will show a beautifull styled text as you want.

Why VeryRichText

I needed a widget to show text with different color and format, RichText was the answer but it not work really good with dynamic data. So I make something to parse a simple markuped text and build a RichText Widget with settings from the markup.

Getting Started

It's very simple, set the variable you need, wrap the text inside square brackets and specify the variable name at the start.
You can also use only the color with hex code.

Screenshot

VeryRichTextWidget(
  "[blue Hello] [greenBold World][#aa0000 !]\nText without style",
  baseStyle: TextStyle(
    fontSize: 22,
    color: Colors.black
  ),
  variables: [
    RichTextVar(name: "blue", style: TextStyle(color: Colors.blue)),
    RichTextVar(name: "greenBold", style: TextStyle(color: Colors.green, fontWeight: FontWeight.bold))
  ]
)

About

A Flutter widget to make RichText Widget more useful

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages