Search code examples
htmlflutterdartflutter-dependenciesflutter-web

How to change html text to normal text parse in texteditingcontroller() to edit in textformfield


I want to remove html tags or format html text to normal text and also tried to added html package that helps to parsing text widget and it working for display text but when parsing texteditingcontroller()' to edit text in textformfield' but html text in between edit text it doesn't work for that i tried htmleditorenhanced' Package it returns missingpluginexception' and hanging issue

And to remove html tags, i tried with htmlparser' it is not proper text

Any other way to change html string to normal


Solution

  • with package:html you can get text of document nodes

    import 'package:html/parser.dart' show parse;
    import 'package:html/dom.dart';
    
    var document = parse(html);
    for(var child in document.children){
      for(var node in child.children){
       print(node.text);
      }
    }