handleInsertImage method

Future<void> handleInsertImage(
  1. BuildContext context
)

Shows the dialog to insert an image and inserts it if confirmed.

Implementation

Future<void> handleInsertImage(BuildContext context) async {
  final result = await showImageInsertDialog(context, labels: document.labels);
  if (result != null) {
    final src = result['src']!;
    document.eventHandler.handleInsertNode(
      'image',
      {'src': src},
    );
  }
}