You can use the package dart:html
to do what you want, I was able to play what you want by removing the &
, see if my solution helps you.
Another thing is that your String was with some wrong codes according to the expected result... Fixed to:
"Data de coleta superior há 15 dias não é permitida."
Here’s an example of how the code looks:
import 'dart:html' as html;
void main(){
var myString="Data de coleta superior há 15 dias não é permitida.";
print(_parseHtmlString(myString));
}
String _parseHtmlString(String htmlString) {
var text = html.Element.span()..appendHtml(htmlString);
return text.innerText;
}
You can test here on Dartpad.
Source: Decode HTML encoded text in Dart.