diff --git a/lib/editors/checklist_editor.dart b/lib/editors/checklist_editor.dart index cb55ed83..a75d55b8 100644 --- a/lib/editors/checklist_editor.dart +++ b/lib/editors/checklist_editor.dart @@ -194,8 +194,8 @@ class ChecklistEditorState extends State ), onUndoSelected: _undo, onRedoSelected: _redo, - undoAllowed: null, - redoAllowed: null, + undoAllowed: false, + redoAllowed: false, ); } diff --git a/lib/editors/journal_editor.dart b/lib/editors/journal_editor.dart index 4ad47dda..8b8ed10f 100644 --- a/lib/editors/journal_editor.dart +++ b/lib/editors/journal_editor.dart @@ -116,8 +116,8 @@ class JournalEditorState extends State body: editor, onUndoSelected: _undo, onRedoSelected: _redo, - undoAllowed: null, - redoAllowed: null, + undoAllowed: false, + redoAllowed: false, ); } diff --git a/lib/editors/markdown_editor.dart b/lib/editors/markdown_editor.dart index 7ebedbe2..8127a07a 100644 --- a/lib/editors/markdown_editor.dart +++ b/lib/editors/markdown_editor.dart @@ -138,8 +138,8 @@ class MarkdownEditorState extends State body: editor, onUndoSelected: _undo, onRedoSelected: _redo, - undoAllowed: null, - redoAllowed: null, + undoAllowed: false, + redoAllowed: false, extraBottomWidget: markdownToolbar, ); } diff --git a/lib/editors/scaffold.dart b/lib/editors/scaffold.dart index a8200b9d..a35fd914 100644 --- a/lib/editors/scaffold.dart +++ b/lib/editors/scaffold.dart @@ -61,6 +61,8 @@ class _EditorScaffoldState extends State { void initState() { super.initState(); + note = widget.editorState.getNote(); + SchedulerBinding.instance! .addPostFrameCallback((_) => _initStateWithContext()); } @@ -86,8 +88,6 @@ class _EditorScaffoldState extends State { if (widget.editMode) { editingMode = true; } - - note = widget.editorState.getNote(); }); }