我在Ffltter应用程序中使用QuillHtmlEditor包,每当我使用该编辑器导航到页面时,文本编辑器加载大约需要200-500毫秒.有没有办法加快加载时间,使其对用户不可见?
这就是我如何实例化它:
QuillHtmlEditor(
controller: controller,
isEnabled: widget.enabled,
ensureVisible: false,
minHeight: 500,
autoFocus: false,
textStyle: widget.editorTextStyle,
hintTextStyle: _hintTextStyle,
hintTextAlign: TextAlign.start,
padding: const EdgeInsets.only(left: 10, top: 10),
hintTextPadding: const EdgeInsets.only(left: 20),
backgroundColor: _backgroundColor,
onEditingComplete: (s) => debugPrint('Editing completed $s'),
loadingBuilder: (context) {
return const Center(
child: CircularProgressIndicator(
strokeWidth: 1,
color: Colors.red,
));
},
onTextChanged: (text) => debugPrint('widget text change $text'),
onEditorCreated: () {
debugPrint('Editor has been loaded');
setHtmlText(widget.controller?.text ?? '');
},
onEditorResized: (height) =>
debugPrint('Editor resized $height'),
),