feat: added Note to linkActionPickerDelegate (#741)

pull/745/head
dani 3 years ago committed by GitHub
parent dfc852e679
commit 15e7dfed21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      lib/src/widgets/link.dart
  2. 2
      lib/src/widgets/raw_editor.dart

@ -42,10 +42,10 @@ enum LinkMenuAction {
typedef LinkActionPicker = Future<LinkMenuAction> Function(Node linkNode);
typedef LinkActionPickerDelegate = Future<LinkMenuAction> Function(
BuildContext context, String link);
BuildContext context, String link, Node node);
Future<LinkMenuAction> defaultLinkActionPickerDelegate(
BuildContext context, String link) async {
BuildContext context, String link, Node node) async {
switch (defaultTargetPlatform) {
case TargetPlatform.iOS:
return _showCupertinoLinkMenu(context, link);

@ -783,7 +783,7 @@ class RawEditorState extends EditorState
Future<LinkMenuAction> _linkActionPicker(Node linkNode) async {
final link = linkNode.style.attributes[Attribute.link.key]!.value!;
return widget.linkActionPickerDelegate(context, link);
return widget.linkActionPickerDelegate(context, link, linkNode);
}
bool _showCaretOnScreenScheduled = false;

Loading…
Cancel
Save