html-editor-enhanced
html-editor-enhanced copied to clipboard
[QUESTION] it seemed conflict after to set onInit and initialText
hi , i am studying it, i want to a display the Output text,but it rasie error:
Height of Platform View type: [c3ZXXQAN7lJBQQ==] may not be set. Defaulting to `height: 100%`.
Set `style.height` to any appropriate value to stop this message.
Width of Platform View type: [c3ZXXQAN7lJBQQ==] may not be set. Defaulting to `width: 100%`.
Set `style.width` to any appropriate value to stop this message.
done
Error: Unexpected null value.
at Object.throw_ [as throw] (http://localhost:58736/dart_sdk.js:5391:11)
at Object.nullCheck (http://localhost:58736/dart_sdk.js:5726:30)
at html_editor_controller_web.HtmlEditorController.new.disable
(http://localhost:58736/packages/html_editor_enhanced/src/html_editor_controller_unsupported.dart.lib.js:8343:12)
at http://localhost:58736/packages/blog_mvapp/testaa.dart.lib.js:735:808
at html_editor_widget_web._HtmlEditorWidgetWebState.new.<anonymous>
(http://localhost:58736/packages/html_editor_enhanced/src/html_editor_controller_unsupported.dart.lib.js:8715:77)
at Generator.next (<anonymous>)
at runBody (http://localhost:58736/dart_sdk.js:43013:34)
at Object._async [as async] (http://localhost:58736/dart_sdk.js:43044:7)
at http://localhost:58736/packages/html_editor_enhanced/src/html_editor_controller_unsupported.dart.lib.js:8713:26
at Object._checkAndCall (http://localhost:58736/dart_sdk.js:5603:16)
at Object.dcall (http://localhost:58736/dart_sdk.js:5608:17)
at HTMLIFrameElement.<anonymous> (http://localhost:58736/dart_sdk.js:115918:21)
my code, could you help me, what am i missing?
child: HtmlEditor(
controller: controller,
htmlEditorOptions: HtmlEditorOptions(
autoAdjustHeight: false,
hint: 'Your text here...',
shouldEnsureVisible: true,
initialText: result, // 初始化的默认文本
),
// 在初始化时,禁用编辑功能
callbacks: Callbacks(
onInit: () => controller.disable()),
otherOptions: const OtherOptions(
height: 400,
),
htmlToolbarOptions: const HtmlToolbarOptions(
toolbarPosition: ToolbarPosition.custom //to remove toolbar
),
),
same issue here !
Looks like it is complaining when you try to disable the editor immediately. Maybe try waiting for one second before disabling to see if error goes away?