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(); ..startCursorTimer();
} }
SchedulerBinding.instance!.addPostFrameCallback( SchedulerBinding.instance!.addPostFrameCallback((_) {
(_) => _updateOrDisposeSelectionOverlayIfNeeded()); if (!mounted) {
return;
}
_updateOrDisposeSelectionOverlayIfNeeded();
});
if (mounted) { if (mounted) {
setState(() { setState(() {
// Use widget.controller.value in build() // Use widget.controller.value in build()

Loading…
Cancel
Save