flutter html

Solutions on MaxInterview for flutter html by the best coders in the world

showing results for - "flutter html"
Damián
17 Jan 2018
1This 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.
2
3dependencies:
4  flutter_html: ^0.8.2
5and imports and code to render html
6
7import 'package:flutter_html/flutter_html.dart';
8import 'package:html/dom.dart' as dom;
9
10
11 body: new Center(
12            child: SingleChildScrollView(
13              child: Html(
14                data: """
15                <div>Follow<a class='sup'><sup>pl</sup></a> 
16                  Below hr
17                    <b>Bold</b>
18                <h1>what was sent down to you from your Lord</h1>, 
19                and do not follow other guardians apart from Him. Little do 
20                <span class='h'>you remind yourselves</span><a class='f'><sup f=2437>1</sup></a></div>
21                """,
22                padding: EdgeInsets.all(8.0),
23                onLinkTap: (url) {
24                  print("Opening $url...");
25                },
26                customRender: (node, children) {
27                  if (node is dom.Element) {
28                    switch (node.localName) {
29                      case "custom_tag": // using this, you can handle custom tags in your HTML 
30                        return Column(children: children);
31                    }
32                  }
33                },
34              ),
35            ),
36          )