File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,9 @@ class SelectableHtml extends StatelessWidget {
190190 /// **onLinkTap** This function is called whenever a link (`<a href>` )
191191 /// is tapped.
192192 ///
193+ /// **onAnchorTap** This function is called whenever an anchor (#anchor-id)
194+ /// is tapped.
195+ ///
193196 /// **tagsList** Tag names in this array will be the only tags rendered. By default all tags that support selectable content are rendered.
194197 ///
195198 /// **style** Pass in the style information for the Html here.
@@ -212,6 +215,7 @@ class SelectableHtml extends StatelessWidget {
212215 Key ? key,
213216 required this .data,
214217 this .onLinkTap,
218+ this .onAnchorTap,
215219 this .onCssParseError,
216220 this .shrinkWrap = false ,
217221 this .style = const {},
@@ -223,6 +227,7 @@ class SelectableHtml extends StatelessWidget {
223227 Key ? key,
224228 required this .document,
225229 this .onLinkTap,
230+ this .onAnchorTap,
226231 this .onCssParseError,
227232 this .shrinkWrap = false ,
228233 this .style = const {},
@@ -239,6 +244,10 @@ class SelectableHtml extends StatelessWidget {
239244 /// A function that defines what to do when a link is tapped
240245 final OnTap ? onLinkTap;
241246
247+ /// A function that defines what to do when an anchor link is tapped. When this value is set,
248+ /// the default anchor behaviour is overwritten.
249+ final OnTap ? onAnchorTap;
250+
242251 /// A function that defines what to do when CSS fails to parse
243252 final OnCssParseError ? onCssParseError;
244253
@@ -265,6 +274,7 @@ class SelectableHtml extends StatelessWidget {
265274 key: null ,
266275 htmlData: doc,
267276 onLinkTap: onLinkTap,
277+ onAnchorTap: onAnchorTap,
268278 onImageTap: null ,
269279 onCssParseError: onCssParseError,
270280 onImageError: null ,
You can’t perform that action at this time.
0 commit comments