Remove exception when widget is not mounted

pull/236/head
Till Friebe 4 years ago
parent 404857817b
commit ee45815da5
  1. 8
      lib/src/widgets/raw_editor.dart

@ -483,8 +483,12 @@ class RawEditorState extends EditorState
..startCursorTimer();
}
SchedulerBinding.instance!.addPostFrameCallback(
(_) => _updateOrDisposeSelectionOverlayIfNeeded());
SchedulerBinding.instance!.addPostFrameCallback((_) {
if (!mounted) {
return;
}
_updateOrDisposeSelectionOverlayIfNeeded();
});
if (mounted) {
setState(() {
// Use widget.controller.value in build()

Loading…
Cancel
Save