Fix exceptions

Minor problems because of the null safety migration
This commit is contained in:
Vishesh Handa
2021-05-25 11:04:47 +02:00
parent c0a42aab54
commit 94f8307315
4 changed files with 8 additions and 8 deletions

View File

@ -194,8 +194,8 @@ class ChecklistEditorState extends State<ChecklistEditor>
), ),
onUndoSelected: _undo, onUndoSelected: _undo,
onRedoSelected: _redo, onRedoSelected: _redo,
undoAllowed: null, undoAllowed: false,
redoAllowed: null, redoAllowed: false,
); );
} }

View File

@ -116,8 +116,8 @@ class JournalEditorState extends State<JournalEditor>
body: editor, body: editor,
onUndoSelected: _undo, onUndoSelected: _undo,
onRedoSelected: _redo, onRedoSelected: _redo,
undoAllowed: null, undoAllowed: false,
redoAllowed: null, redoAllowed: false,
); );
} }

View File

@ -138,8 +138,8 @@ class MarkdownEditorState extends State<MarkdownEditor>
body: editor, body: editor,
onUndoSelected: _undo, onUndoSelected: _undo,
onRedoSelected: _redo, onRedoSelected: _redo,
undoAllowed: null, undoAllowed: false,
redoAllowed: null, redoAllowed: false,
extraBottomWidget: markdownToolbar, extraBottomWidget: markdownToolbar,
); );
} }

View File

@ -61,6 +61,8 @@ class _EditorScaffoldState extends State<EditorScaffold> {
void initState() { void initState() {
super.initState(); super.initState();
note = widget.editorState.getNote();
SchedulerBinding.instance! SchedulerBinding.instance!
.addPostFrameCallback((_) => _initStateWithContext()); .addPostFrameCallback((_) => _initStateWithContext());
} }
@ -86,8 +88,6 @@ class _EditorScaffoldState extends State<EditorScaffold> {
if (widget.editMode) { if (widget.editMode) {
editingMode = true; editingMode = true;
} }
note = widget.editorState.getNote();
}); });
} }