markup_text 0.1.0 copy "markup_text: ^0.1.0" to clipboard
markup_text: ^0.1.0 copied to clipboard

outdated

Flutter widget to use Markup to easily create formatted Text with colors, style and links.

markup_text #

GitHub license

Flutter widget to use Markup to easily create formatted Text.

Please star the repo to support the project

Resources: #

Usage #

MarkupText is a wrapper for RichText that simplifies the creation of text with mixed styles.

MarkupText("This is a (b)Markup(/b) example with (c deepPurple)a purple text(/c)")

style #

The style parameter works as with the Text widget. Styles defined will merge with default Style for Text.

MarkupText(
            "This is a (b)bold(/b) text (a http://flutter.dev)with a link(/a),"
            " an (u)underlined(/u) word (a http://pub.dev)with"
            " a second link containing a word in (i)italics(/i)(/a) and (c #ff0000)coloured(/c) words"
            " (c deepPurpleAccent)here(/c) and (c black87)there(/c).",
            style: TextStyle(fontSize: 18),
          ),

Markup language #

The following tags are recognized by the widget

Bold

Use tag (b)..(/b) for bold text

MarkupText("This is a (b)bold(/b) text")

Italic

Use tag (i)..(/i) for italic text

MarkupText("This is an (i)italic(/i) text")

Underlined

Use tag (u)..(/u) for underlined text

MarkupText("This is an (u)underlined(/u) text")

Use tag (a <url>)..(/a) to create links

MarkupText("(a http://example.com)This is a link(/a)")

Colors

Use tag (c <color>)..(/c) to create colored text

MarkupText("(c #ff0000)Colors from RGB codes(/c)")
MarkupText("(c amber)You can also use named colors(/c)")

<color> can be either a RGB color code started with # or a named color. Valid names are the ones defined on the Flutter class Colors:

Color Name Color
amber
amberAccent
black
black12
black26
black38
black45
black54
black87
blue
blueAccent
blueGrey
brown
cyan
cyanAccent
deepOrange
deepOrangeAccent
deepPurple
deepPurpleAccent
green
greenAccent
grey
indigo
indigoAccent
lightBlue
lightBlueAccent
lightGreen
lightGreenAccent
lime
limeAccent
orange
orangeAccent
pink
pinkAccent
purple
purpleAccent
red
redAccent
teal
tealAccent
transparent
white
white10
white12
white24
white30
white38
white54
white60
white70
yellow
yellowAccent
15
likes
0
pub points
74%
popularity

Publisher

verified publisherpoquesoft.net

Flutter widget to use Markup to easily create formatted Text with colors, style and links.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, url_launcher

More

Packages that depend on markup_text