santa112358 / hashtagable

Widgets and functions to implement hashTag decorated text.
https://pub.dev/packages/hashtagable
MIT License
30 stars 50 forks source link

A function that can be copied when a character is tapped #71

Closed naokikotani closed 3 years ago

naokikotani commented 3 years ago

I would like to copy text like RichText.

santa112358 commented 3 years ago

Hi @naokikotani, thank you for the request. I recommend you to use SelectableText.rich and getHashtagTextSpan

SelectableText.rich(
  getHashTagTextSpan(
    decoratedStyle:
        TextStyle(fontSize: 22, color: Colors.black),
    basicStyle: TextStyle(fontSize: 22, color: Colors.blue),
    source: "#Hello World",
  ),
)

You can implement hashtagText with copying feature by this code. If you have any questions, please reopen this issue. Thank you.