Closed YueYongDev closed 4 years ago
It seems to work fine in my sample app. If your html is huge, it will take sometime to parse and render. See this screencast:
However, a new major release will have async render which should help with complicated html like yours, compare the above screencast with this:
You can try the new version by changing your pubspec to use flutter_widget_from_html: ^0.4.0-rc.2020043001
.
Thank you very much. When I used flutter_widget_from_html: ^0.4.0-rc.2020043001
, the problem was solved. I still have a problem, how to customize the style of <code>
tag, what should I do if I want to add background to the code segment
Do you have control of the HTML? You should be able to use <code style="background-color: #f00">...</code>
.
Do you have control of the HTML? You should be able to use
<code style="background-color: #f00">...</code>
.
I can't control this HTML because it's someone else's page
If that is the case then you can apply custom styling like these:
HtmlWidget(
html,
customStylesBuilder: (e) {
switch (e.localName) {
case 'code':
return ['background-color', '#f00'];
}
return null;
},
),
That solved my problem. Thank you very much
When I parse a long piece of HTML text which contains a large number of pictures and load slowly, the phone gets stuck. The html text is as follows: