fix: Cannot type on empty document in latest changes

This commit is contained in:
Lucas.Xu 2023-05-31 11:44:37 +08:00
commit 9199d0e94d

View file

@ -99,7 +99,9 @@ class _HomePageState extends State<HomePage> {
}),
_buildListTile(context, 'With Empty Document', () {
final jsonString = Future<String>.value(
jsonEncode(EditorState.empty().document.toJson()).toString(),
jsonEncode(
EditorState.blank(withInitialText: true).document.toJson(),
).toString(),
);
_loadEditor(context, jsonString);
}),
@ -108,7 +110,9 @@ class _HomePageState extends State<HomePage> {
_buildSeparator(context, 'Text Robot'),
_buildListTile(context, 'Type Text Automatically', () async {
final jsonString = Future<String>.value(
jsonEncode(EditorState.empty().document.toJson()).toString(),
jsonEncode(
EditorState.blank(withInitialText: true).document.toJson(),
).toString(),
);
await _loadEditor(context, jsonString);