ClickablePattern constructor
const
ClickablePattern({
- required String name,
- required String pattern,
- bool enabled = true,
- PatternClicked? onClicked,
- TextStyle? style,
- InlineSpan spanBuilder(
- String text,
- ClickablePattern pattern
- dynamic onSpanCreation(
- InlineSpan span,
- int index
Pattern class used by ClickableText widget for pattern finding, and click function bindings.
pattern = regex string to search on text and convert them to different InlineSpan.
name = easy way to tell which pattern is activated.
onClicked = function that is called when InlineSpan is clicked.
style = style for the InlineSpan created.
spanBuilder = for more specific widget building, will not include the onClicked and style attributes, you need to add them yourself.
Implementation
const ClickablePattern({
required this.name,
required this.pattern,
this.enabled = true,
this.onClicked,
this.style,
this.spanBuilder,
this.onSpanCreation,
});