handleInsertLink method

void handleInsertLink(
  1. BuildContext context
)

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

Implementation

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.saveState(description: 'Insert link', forceNewAction: true);
    handleInsertNodeExceution(
      'link',
      document,
      {'url': url, 'text': text},
    );
  }
}