Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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