Skip to content
Merged
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
10 changes: 10 additions & 0 deletions lib/flutter_html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ class SelectableHtml extends StatelessWidget {
/// **onLinkTap** This function is called whenever a link (`<a href>`)
/// is tapped.
///
/// **onAnchorTap** This function is called whenever an anchor (#anchor-id)
/// is tapped.
///
/// **tagsList** Tag names in this array will be the only tags rendered. By default all tags that support selectable content are rendered.
///
/// **style** Pass in the style information for the Html here.
Expand All @@ -212,6 +215,7 @@ class SelectableHtml extends StatelessWidget {
Key? key,
required this.data,
this.onLinkTap,
this.onAnchorTap,
this.onCssParseError,
this.shrinkWrap = false,
this.style = const {},
Expand All @@ -223,6 +227,7 @@ class SelectableHtml extends StatelessWidget {
Key? key,
required this.document,
this.onLinkTap,
this.onAnchorTap,
this.onCssParseError,
this.shrinkWrap = false,
this.style = const {},
Expand All @@ -239,6 +244,10 @@ class SelectableHtml extends StatelessWidget {
/// A function that defines what to do when a link is tapped
final OnTap? onLinkTap;

/// A function that defines what to do when an anchor link is tapped. When this value is set,
/// the default anchor behaviour is overwritten.
final OnTap? onAnchorTap;

/// A function that defines what to do when CSS fails to parse
final OnCssParseError? onCssParseError;

Expand All @@ -265,6 +274,7 @@ class SelectableHtml extends StatelessWidget {
key: null,
htmlData: doc,
onLinkTap: onLinkTap,
onAnchorTap: onAnchorTap,
onImageTap: null,
onCssParseError: onCssParseError,
onImageError: null,
Expand Down