Skip to content

Commit

Permalink
Add onInitialTextLoadComplete callback
Browse files Browse the repository at this point in the history
  • Loading branch information
tddang-linagora authored and hoangdat committed Sep 13, 2024
1 parent cc63bc2 commit 3274d7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/src/widgets/html_editor_widget_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,8 @@ class _HtmlEditorWidgetWebState extends State<HtmlEditorWidget> {
}
if (widget.htmlEditorOptions.initialText != null) {
widget.controller.setText(widget.htmlEditorOptions.initialText!);
widget.callbacks?.onInitialTextLoadComplete?.call(
widget.htmlEditorOptions.initialText!);
}
var data = <String, Object>{'type': 'toIframe: getHeight'};
data['view'] = createdViewId;
Expand Down
3 changes: 3 additions & 0 deletions lib/utils/callbacks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -194,4 +195,6 @@ class Callbacks {
void Function(List<dynamic>? types)? onDragEnter;

void Function(List<dynamic>? types)? onDragLeave;

void Function(String initialText)? onInitialTextLoadComplete;
}

0 comments on commit 3274d7f

Please sign in to comment.