@@ -2,27 +2,30 @@ 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
- Html ({
8
- Key key,
9
- @required this .data,
10
- this .padding,
11
- this .backgroundColor,
12
- this .defaultTextStyle,
13
- this .onLinkTap,
14
- this .renderNewlines = false ,
15
- this .customRender,
16
- this .customEdgeInsets,
17
- this .customTextStyle,
18
- this .blockSpacing = 14.0 ,
19
- this .useRichText = false ,
20
- this .onImageError,
21
- this .linkStyle = const TextStyle (
22
- decoration: TextDecoration .underline,
23
- color: Colors .blueAccent,
24
- decorationColor: Colors .blueAccent),
25
- }) : super (key: key);
8
+ Html (
9
+ {Key key,
10
+ @required this .data,
11
+ this .padding,
12
+ this .backgroundColor,
13
+ this .defaultTextStyle,
14
+ this .onLinkTap,
15
+ this .renderNewlines = false ,
16
+ this .customRender,
17
+ this .customEdgeInsets,
18
+ this .customTextStyle,
19
+ this .blockSpacing = 14.0 ,
20
+ this .useRichText = false ,
21
+ this .onImageError,
22
+ this .linkStyle = const TextStyle (
23
+ decoration: TextDecoration .underline,
24
+ color: Colors .blueAccent,
25
+ decorationColor: Colors .blueAccent),
26
+ this .imageProperties,
27
+ this .onImageTap})
28
+ : super (key: key);
26
29
27
30
final String data;
28
31
final EdgeInsetsGeometry padding;
@@ -35,6 +38,10 @@ class Html extends StatelessWidget {
35
38
final ImageErrorListener onImageError;
36
39
final TextStyle linkStyle;
37
40
41
+ /// Properties for the Image widget that gets rendered by the rich text parser
42
+ final ImageProperties imageProperties;
43
+ final OnImageTap onImageTap;
44
+
38
45
/// Either return a custom widget for specific node types or return null to
39
46
/// fallback to the default rendering.
40
47
final CustomRender customRender;
@@ -61,6 +68,8 @@ class Html extends StatelessWidget {
61
68
html: data,
62
69
onImageError: onImageError,
63
70
linkStyle: linkStyle,
71
+ imageProperties: imageProperties,
72
+ onImageTap: onImageTap,
64
73
)
65
74
: HtmlOldParser (
66
75
width: width,
0 commit comments