diff --git a/lib/src/widgets/html_editor_widget_web.dart b/lib/src/widgets/html_editor_widget_web.dart index 9190c1c6..af5279b5 100644 --- a/lib/src/widgets/html_editor_widget_web.dart +++ b/lib/src/widgets/html_editor_widget_web.dart @@ -911,6 +911,8 @@ class _HtmlEditorWidgetWebState extends State { } if (widget.htmlEditorOptions.initialText != null) { widget.controller.setText(widget.htmlEditorOptions.initialText!); + widget.callbacks?.onInitialTextLoadComplete?.call( + widget.htmlEditorOptions.initialText!); } var data = {'type': 'toIframe: getHeight'}; data['view'] = createdViewId; diff --git a/lib/utils/callbacks.dart b/lib/utils/callbacks.dart index 06206341..186642cf 100644 --- a/lib/utils/callbacks.dart +++ b/lib/utils/callbacks.dart @@ -28,6 +28,7 @@ class Callbacks { this.onTextFontSizeChanged, this.onDragEnter, this.onDragLeave, + this.onInitialTextLoadComplete, }); /// Called before certain commands are fired and the editor is in rich text view. @@ -194,4 +195,6 @@ class Callbacks { void Function(List? types)? onDragEnter; void Function(List? types)? onDragLeave; + + void Function(String initialText)? onInitialTextLoadComplete; }