in dart parse HTML string to DOM
You can create an element by parsing HTML text:
new Element.html("YOUR HTML STRING HERE");
EDIT
You may need to pass a NodeValidator to get the entire text rendered like:
NodeValidator nodeValidator = new NodeValidatorBuilder() ..allowTextElements(); // ..allowHtml5() // ..allowElement('Button', attributes: ['ng-disabled']);new Element.html("YOUR HTML STRING HERE", validator: nodeValidator);
If you run the application you get log messages like "element/attribute xxx removed from ..." if some of the text was not accepted by the NodeValidator.
Check out this article in dart documentation
You can use this for dart
import 'dart:html';
and carryout parsing like this
querySelector('#theid').text = 'Wake up, sleepy head!';}
In case of flutter, you have to add the "html" package in the pubspec.yaml below the cupertino_icons dependency like this for example
html: ^0.13.3+3
and then the dart file you have to import it like
import 'package:html/parser.dart' as parser;
and then carry out parsing as before but remember to add the alias name before each method!