@@ -2,6 +2,7 @@ library flutter_html;
2
2
3
3
import 'package:flutter/material.dart' ;
4
4
import 'package:flutter_html/html_parser.dart' ;
5
+ import 'image_properties.dart' ;
5
6
6
7
class Html extends StatelessWidget {
7
8
Html ({
@@ -22,6 +23,9 @@ class Html extends StatelessWidget {
22
23
decoration: TextDecoration .underline,
23
24
color: Colors .blueAccent,
24
25
decorationColor: Colors .blueAccent),
26
+ this .imageProperties,
27
+ this .onImageTap,
28
+ this .showImages = true ,
25
29
}) : super (key: key);
26
30
27
31
final String data;
@@ -35,6 +39,11 @@ class Html extends StatelessWidget {
35
39
final ImageErrorListener onImageError;
36
40
final TextStyle linkStyle;
37
41
42
+ /// Properties for the Image widget that gets rendered by the rich text parser
43
+ final ImageProperties imageProperties;
44
+ final OnImageTap onImageTap;
45
+ final bool showImages;
46
+
38
47
/// Either return a custom widget for specific node types or return null to
39
48
/// fallback to the default rendering.
40
49
final CustomRender customRender;
@@ -61,6 +70,9 @@ class Html extends StatelessWidget {
61
70
html: data,
62
71
onImageError: onImageError,
63
72
linkStyle: linkStyle,
73
+ imageProperties: imageProperties,
74
+ onImageTap: onImageTap,
75
+ showImages: showImages,
64
76
)
65
77
: HtmlOldParser (
66
78
width: width,
@@ -71,6 +83,7 @@ class Html extends StatelessWidget {
71
83
blockSpacing: blockSpacing,
72
84
onImageError: onImageError,
73
85
linkStyle: linkStyle,
86
+ showImages: showImages,
74
87
),
75
88
),
76
89
);
0 commit comments