0

Text widget in Flutter dose not support a special charterers like &, where sometimes this charterer comes like "first & second" from the database, or "&quot" should be ".

Text widget should read/convert these characters automatically. I have already fixed by following lines, But I need to put this solution in all Text widgets I have in my app.

Is it possible to give all Text widgets the possibility to read these special charterers directly in main function in runAPP or "MaterialApp" without putting the following lines in all Text widgets the app has?

      final document = parse(htmlString);
      final String parsedString = parse(document.body.text).documentElement.text;

1 Answer 1

0

Use this package flutter_html and try as follows:

Html(data: htmlString, style: {
              "body": Style(
                  fontSize: FontSize(18),
                  color: Colors.black,
                  fontWeight: FontWeight.normal)
            }),
Sign up to request clarification or add additional context in comments.

1 Comment

I know this plugin, but I need to change all Text widgets to Html, is there any solution to solve in main function or MaterialApp?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.