From a1d1a5cd2a0567755ea397ff586610ab63fe4c6d Mon Sep 17 00:00:00 2001 From: florianh01 <78513002+florianh01@users.noreply.github.com> Date: Fri, 5 Mar 2021 00:32:05 +0100 Subject: [PATCH] Adding an article to week 02 of articles of the week (#51) --- lib/widgets/raw_editor.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/widgets/raw_editor.dart b/lib/widgets/raw_editor.dart index 7d95f4a0..6b095a27 100644 --- a/lib/widgets/raw_editor.dart +++ b/lib/widgets/raw_editor.dart @@ -905,6 +905,7 @@ class RawEditorState extends EditorState SchedulerBinding.instance.addPostFrameCallback( (Duration _) => _updateOrDisposeSelectionOverlayIfNeeded()); + if (!mounted) return; setState(() { // Use widget.controller.value in build() // Trigger build and updateChildren @@ -959,6 +960,7 @@ class RawEditorState extends EditorState } _onChangedClipboardStatus() { + if (!mounted) return; setState(() { // Inform the widget that the value of clipboardStatus has changed. // Trigger build and updateChildren