有什么方法可以直接从TextField将String值保存到控制器(TextEditingController)中,而无需在此插件https://pub.dev/packages/flutter_html_editor中使用keyEditor.currentState.getText()
我需要使用控制器,因为有时使用此控制器时会得到 null 值:
final txt = await keyEditor.currentState.getText();
如何避免空值。如果我这样添加它会很好:
HtmlEditor(
controller: comment_control,
hint: "Your text here...",
//value: "text content initial, if any",
key: keyEditor,
height: 400,
),
谢谢