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 {
190
190
/// **onLinkTap** This function is called whenever a link (`<a href>` )
191
191
/// is tapped.
192
192
///
193
+ /// **onAnchorTap** This function is called whenever an anchor (#anchor-id)
194
+ /// is tapped.
195
+ ///
193
196
/// **tagsList** Tag names in this array will be the only tags rendered. By default all tags that support selectable content are rendered.
194
197
///
195
198
/// **style** Pass in the style information for the Html here.
@@ -212,6 +215,7 @@ class SelectableHtml extends StatelessWidget {
212
215
Key ? key,
213
216
required this .data,
214
217
this .onLinkTap,
218
+ this .onAnchorTap,
215
219
this .onCssParseError,
216
220
this .shrinkWrap = false ,
217
221
this .style = const {},
@@ -223,6 +227,7 @@ class SelectableHtml extends StatelessWidget {
223
227
Key ? key,
224
228
required this .document,
225
229
this .onLinkTap,
230
+ this .onAnchorTap,
226
231
this .onCssParseError,
227
232
this .shrinkWrap = false ,
228
233
this .style = const {},
@@ -239,6 +244,10 @@ class SelectableHtml extends StatelessWidget {
239
244
/// A function that defines what to do when a link is tapped
240
245
final OnTap ? onLinkTap;
241
246
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
+
242
251
/// A function that defines what to do when CSS fails to parse
243
252
final OnCssParseError ? onCssParseError;
244
253
@@ -265,6 +274,7 @@ class SelectableHtml extends StatelessWidget {
265
274
key: null ,
266
275
htmlData: doc,
267
276
onLinkTap: onLinkTap,
277
+ onAnchorTap: onAnchorTap,
268
278
onImageTap: null ,
269
279
onCssParseError: onCssParseError,
270
280
onImageError: null ,
You can’t perform that action at this time.
0 commit comments