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 apply custom style to all the text? #9

Closed jpgpuyo closed 4 years ago

jpgpuyo commented 4 years ago

Hello,

First of all, thanks for your contribution, this is very useful package. But I would like to apply custom style to all the text,with the parameter 'style', something like that:

StyledText(
text: 'Test: <bold>bold</bold> text.',
style: GoogleFonts.sourceSansPro(
fontSize: 20,
fontWeight: FontWeight.normal,
 ),
 styles: {
 'bold': TextStyle(fontWeight: FontWeight.bold),                              
 },
),

So, is it possible change the default style to all text?. I tried and the text disappears. If I remove the style parameter, then the text appears again. Thanks!

jpgpuyo commented 4 years ago

I fixed the issue, the problem was that the color it was not specified and the text is invisible. It was crazy to detect because the framework in this case is not providing any tip about that :) Thanks!

andyduke commented 4 years ago

Perhaps Flutter Inspector will help you in this situation. https://flutter.dev/docs/development/tools/devtools/inspector