Add node params to custom recognizer function (#1199)

pull/1202/head
jiangchong 2 years ago committed by GitHub
parent c0ed80b7a4
commit d4aaea239f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      lib/src/widgets/delegate.dart
  2. 2
      lib/src/widgets/text_line.dart

@ -15,7 +15,7 @@ typedef EmbedsBuilder = EmbedBuilder Function(Embed node);
typedef CustomStyleBuilder = TextStyle Function(Attribute attribute);
typedef CustomRecognizerBuilder = GestureRecognizer? Function(
Attribute attribute);
Attribute attribute, Leaf leaf);
/// Delegate interface for the [EditorTextSelectionGestureDetectorBuilder].
///

@ -420,7 +420,7 @@ class _TextLineState extends State<TextLine> {
final nodeStyle = textNode.style;
nodeStyle.attributes.forEach((key, value) {
final recognizer = widget.customRecognizerBuilder!.call(value);
final recognizer = widget.customRecognizerBuilder!.call(value, segment);
if (recognizer != null) {
_linkRecognizers[segment] = recognizer;
return;

Loading…
Cancel
Save