Skip to content

Commit

Permalink
Merge pull request #90 from andreyeurope/master
Browse files Browse the repository at this point in the history
Image properties and onImageTap for the richTextParser, plus some fixes
  • Loading branch information
Sub6Resources authored May 21, 2019
2 parents 913e277 + 6ebc1ce commit 76c1f77
Show file tree
Hide file tree
Showing 3 changed files with 196 additions and 129 deletions.
13 changes: 13 additions & 0 deletions lib/flutter_html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ library flutter_html;

import 'package:flutter/material.dart';
import 'package:flutter_html/html_parser.dart';
import 'image_properties.dart';

class Html extends StatelessWidget {
Html({
Expand All @@ -22,6 +23,9 @@ class Html extends StatelessWidget {
decoration: TextDecoration.underline,
color: Colors.blueAccent,
decorationColor: Colors.blueAccent),
this.imageProperties,
this.onImageTap,
this.showImages = true,
}) : super(key: key);

final String data;
Expand All @@ -35,6 +39,11 @@ class Html extends StatelessWidget {
final ImageErrorListener onImageError;
final TextStyle linkStyle;

/// Properties for the Image widget that gets rendered by the rich text parser
final ImageProperties imageProperties;
final OnImageTap onImageTap;
final bool showImages;

/// Either return a custom widget for specific node types or return null to
/// fallback to the default rendering.
final CustomRender customRender;
Expand All @@ -61,6 +70,9 @@ class Html extends StatelessWidget {
html: data,
onImageError: onImageError,
linkStyle: linkStyle,
imageProperties: imageProperties,
onImageTap: onImageTap,
showImages: showImages,
)
: HtmlOldParser(
width: width,
Expand All @@ -71,6 +83,7 @@ class Html extends StatelessWidget {
blockSpacing: blockSpacing,
onImageError: onImageError,
linkStyle: linkStyle,
showImages: showImages,
),
),
);
Expand Down
Loading

0 comments on commit 76c1f77

Please sign in to comment.