Skip to content

met912/TextManip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

text_manip

Text Manipulation flutter widget.

Installation

Add

text_manip : ^latest_version

to your pubspec.yaml.

Screenshot

Usage

Basic

TextManip(
    style: TextStyle(
        fontSize: 16
    ),
    text: 
        "No tag \n"
        "<b>bold</b> \n"
        "<i>italic</i> \n"
        "<u>underline</u> \n"
        "<color color='0xffff0000'>red</color> \n"
        "<fontSize size='20'>Font Size 20</fontSize> \n"
        "<backgroundColor color='0xff0000ff'>Blue Background</backgroundColor> \n"
        "<b><i><u>Bold, italic and underline</u></i></b>"
);

Custom Tag

Adding custom tag

TextManip.addTags([
    // lineThrough
    TextManipTag(
        regExp: RegExp(r"<lineThrough>(.*?)</lineThrough>"),
        callback: (RegExpMatch regExpMatch) {
            return TextManipText(
                style: TextStyle(
                    decoration: TextDecoration.lineThrough
                ),
                text: regExpMatch.group(1).toString()
            );
        }
    ),
        
    // smile
    TextManipTag(
        regExp: RegExp(r"\[smile\](.*?)\[/smile\]"),
        callback: (RegExpMatch regExpMatch) {
            return TextManipText(
                text: "🤣 " + regExpMatch.group(1).toString() + " 🤣"
            );
        }
    )
]);

Clear All Tags

TextManip.clearTags();

About

Flutter text manipulation widget

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published