handleInsertLink method

Future<void> handleInsertLink(
  1. BuildContext context
)

Shows the dialog to insert a link and inserts it if confirmed.

Implementation

Future<void> handleInsertLink(BuildContext context) async {
  final result = await showFluentLinkDialog(context, labels: document.labels);
  if (result != null) {
    final url = result['url']!;
    final text = result['text']!;
    document.eventHandler.handleInsertNode(
      'link',
      {'url': url, 'text': text},
    );
  }
}