andyduke / styled_text_package

Text widget with formatted text using tags. Makes it easier to use formatted text in multilingual applications.
https://pub.dev/packages/styled_text
BSD 3-Clause "New" or "Revised" License
75 stars 48 forks source link

Color with hex values #16

Closed jaumard closed 3 years ago

jaumard commented 3 years ago

The API I'm using is returning this:

Attack primary target for <color=#86e619>80%</color> damage.\nGain <color=#fff568>Offense Up</color> + apply <color=#fff568>Offense Up</color> to adjacent <color=#fff568>A.I.M.</color> allies for <color=#86e619>2</color> turns.\n\nThis attack cannot miss.

Would be nice if this package can handle that kind of tag

andyduke commented 3 years ago

@jaumard Yes, that would be a nice feature. I'll add it in the near future.

andyduke commented 3 years ago

@jaumard I added a CustomTextStyle class to handle the attributes passed to tags. See example in README.md

jaumard commented 3 years ago

Nice! Thanks!

Zabadam commented 3 years ago

In the initial question, and through the usage of the referenced solution CustomTextStyle(), can "color" be both the <tag> and an attr?