-
Notifications
You must be signed in to change notification settings - Fork 107
/
main.dart
79 lines (71 loc) · 2.14 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import 'package:flutter/material.dart';
import 'package:flutter_html_view/flutter_html_view.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
void main() => runApp(new MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
String html = '''
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
<a href="https://google.com">Google</a>
<br/>
<img alt="Test Image" src="https://source.unsplash.com/random/300x200">
<br/>
<video src="https://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_5mb.mp4"></video>
<br/>
<a data-id="1" href="https://google.com">Go Google</a>
<br/>
<a href="mailto:ponnamkarthik3@gmail.com">Mail to me</a>
<br/>
<video id="video1" >
<source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
</video>
<img src="https://source.unsplash.com/random/300x500">
''';
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: new Text('Plugin example app'),
),
body: new Container(
child: new HtmlView(
data: html,
stylingOptions: null,
styleSheet: MarkdownStyleSheet(),
),
),
),
);
// return new MaterialApp(
// home: new Scaffold(
// appBar: new AppBar(
// title: new Text('Plugin example app'),
// ),
// body: new SingleChildScrollView(
// child: new Center(
// child: new HtmlView(
// data: html,
// baseURL: "https://images.unsplash.com",
// onLaunchFail: (url) {
// print("launch $url failed");
// },
// ),
// ),
// ),
// ),
// );
}
}