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

How to set default text color? #12

Closed cheekiat closed 3 years ago

cheekiat commented 3 years ago

like 'here is test' how to set "here is" text color?

andyduke commented 3 years ago

@cheekiat You can set the color through the style property like this:

StyledText(
  text: 'Test: <bold>bold</bold> text.',
  style: TextStyle(color: Colors.teal),
)

... or using the DefaulTextStyle class, like this:

DefaultTextStyle(
  style: TextStyle(color: Colors.teal),
  child: StyledText(...)
)