rich_text_widget 0.2.1 copy "rich_text_widget: ^0.2.1" to clipboard
rich_text_widget: ^0.2.1 copied to clipboard

outdated

This library is a rich text component, which supplements the function of Flutter rich text that can only splice components. The library is very convenient to apply to internationalized text without sp [...]

README of English #

富文本是很多App都需要的,而且Flutter也提供了富文本功能,但是对于做多语言的APP来说,RichText并不好用,或者说不能用。

rich_text_widget使用起来简单又方便,不用分割字符串

具体使用方法参考如下

RichTextWidget(
      // default Text
      Text(
        'You have pushed the button this many times:',
        style: TextStyle(color: Colors.black),
      ),
      // rich text list
      richTexts: [
        BaseRichText(
          "pushed",
          style: TextStyle(color: Colors.yellow),
          onTap: () => {print("touch pushed")},
        ),
        BaseRichText(
          "button",
          style: TextStyle(color: Colors.red),
          onTap: () => {print("touch button")},
        ),
      ],
    )

展示效果如下

Simulator Screen Shot - iPhone 11 Pro - 2020-08-10 at 10.52.06.png

参数说明

RichTextWidget:

Name type
defaultText Text
richTexts List <BaseRichText>

BaseRichText:

Name type
data String
style TextStyle
onTap Function
4
likes
0
pub points
84%
popularity

Publisher

unverified uploader

This library is a rich text component, which supplements the function of Flutter rich text that can only splice components. The library is very convenient to apply to internationalized text without splitting strings.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on rich_text_widget