insertDocument method
Inserts a document file block at or after blockIndex.
Implementation
int insertDocument({
required String src,
required String fileName,
int? fileSize,
String? fileExtension,
SmartTextAlign alignment = SmartTextAlign.left,
int? blockIndex,
}) {
final targetIndex = blockIndex ?? _editorWidgetState?.focusedBlockIndex;
final index = _documentController.insertDocument(
src: src,
fileName: fileName,
fileSize: fileSize,
fileExtension: fileExtension,
alignment: alignment,
blockIndex: targetIndex,
);
_editorWidgetState?.rebuild();
return index;
}