flutter html code example
Example: flutter html
This plugin doesn`t have any issue, I just created a sample with your HTML and it works fine. Try to replace with below snippet and see if that works.
dependencies:
flutter_html: ^0.8.2
and imports and code to render html
import 'package:flutter_html/flutter_html.dart';
import 'package:html/dom.dart' as dom;
body: new Center(
child: SingleChildScrollView(
child: Html(
data: """
<div>Follow<a class='sup'><sup>pl</sup></a>
Below hr
<b>Bold</b>
<h1>what was sent down to you from your Lord</h1>,
and do not follow other guardians apart from Him. Little do
<span class='h'>you remind yourselves</span><a class='f'><sup f=2437>1</sup></a></div>
""",
padding: EdgeInsets.all(8.0),
onLinkTap: (url) {
print("Opening $url...");
},
customRender: (node, children) {
if (node is dom.Element) {
switch (node.localName) {
case "custom_tag": // using this, you can handle custom tags in your HTML
return Column(children: children);
}
}
},
),
),
)