flutter_html is not parsing some characters in flutter

I am using flutter_html package in my app, to parse the html code from my API. But, I am facing a problem that it is not able to parse some characters like arrows and it is not styling the default numbers which are coming from list tag in html code. Is there any solution/alternative for this?

/*: Html(
     data: "<body><div>"+widget.dataList[widget.index].description!+"</div></body>",
     style: {
        //'p': Style(color: secondaryTextColor),
        'body': Style(
            color: secondaryTextColor,
            textDecorationColor: secondaryTextColor,
            fontSize: FontSize(bodyText2Size - 1),
         ),
      },
),*/

1 answer

  • answered 2022-05-04 09:57 Anandh Krishnan

    Use this package

    html: ^0.15.0
    

    you can use:

    import 'package:html/dom.dart';
    import 'package:html/dom_parsing.dart';
    import 'package:html/parser.dart';
    
    import 'package:html/parser.dart' show parse;
    import 'package:html/dom.dart';
    
    main() {
      var document = parse(
          '<body>Hello world! <a href="www.html5rocks.com">HTML5 rocks!');
      print(document.outerHtml);
    }
    

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum