Skip to content

Commit 76c1f77

Browse files
Merge pull request Sub6Resources#90 from andreyeurope/master
Image properties and onImageTap for the richTextParser, plus some fixes
2 parents 913e277 + 6ebc1ce commit 76c1f77

File tree

3 files changed

+196
-129
lines changed

3 files changed

+196
-129
lines changed

lib/flutter_html.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ library flutter_html;
22

33
import 'package:flutter/material.dart';
44
import 'package:flutter_html/html_parser.dart';
5+
import 'image_properties.dart';
56

67
class Html extends StatelessWidget {
78
Html({
@@ -22,6 +23,9 @@ class Html extends StatelessWidget {
2223
decoration: TextDecoration.underline,
2324
color: Colors.blueAccent,
2425
decorationColor: Colors.blueAccent),
26+
this.imageProperties,
27+
this.onImageTap,
28+
this.showImages = true,
2529
}) : super(key: key);
2630

2731
final String data;
@@ -35,6 +39,11 @@ class Html extends StatelessWidget {
3539
final ImageErrorListener onImageError;
3640
final TextStyle linkStyle;
3741

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+
3847
/// Either return a custom widget for specific node types or return null to
3948
/// fallback to the default rendering.
4049
final CustomRender customRender;
@@ -61,6 +70,9 @@ class Html extends StatelessWidget {
6170
html: data,
6271
onImageError: onImageError,
6372
linkStyle: linkStyle,
73+
imageProperties: imageProperties,
74+
onImageTap: onImageTap,
75+
showImages: showImages,
6476
)
6577
: HtmlOldParser(
6678
width: width,
@@ -71,6 +83,7 @@ class Html extends StatelessWidget {
7183
blockSpacing: blockSpacing,
7284
onImageError: onImageError,
7385
linkStyle: linkStyle,
86+
showImages: showImages,
7487
),
7588
),
7689
);

0 commit comments

Comments
 (0)