Fix "Show toolbar" bug

During the migration to NNBD a bug occurred that prevents the toolbar from
being displayed. The code changes revert to the original code without bug.
pull/120/head
Till Friebe 4 years ago
parent 4c16af4420
commit d893b8439e
  1. 4
      lib/widgets/raw_editor.dart

@ -1094,7 +1094,6 @@ class RawEditorState extends EditorState
@override @override
bool showToolbar() { bool showToolbar() {
if (_selectionOverlay == null || _selectionOverlay!.toolbar != null) {
// Web is using native dom elements to enable clipboard functionality of the // Web is using native dom elements to enable clipboard functionality of the
// toolbar: copy, paste, select, cut. It might also provide additional // toolbar: copy, paste, select, cut. It might also provide additional
// functionality depending on the browser (such as translate). Due to this // functionality depending on the browser (such as translate). Due to this
@ -1102,7 +1101,6 @@ class RawEditorState extends EditorState
if (kIsWeb) { if (kIsWeb) {
return false; return false;
} }
if (_selectionOverlay == null || _selectionOverlay!.toolbar != null) { if (_selectionOverlay == null || _selectionOverlay!.toolbar != null) {
return false; return false;
} }
@ -1110,8 +1108,6 @@ class RawEditorState extends EditorState
_selectionOverlay!.showToolbar(); _selectionOverlay!.showToolbar();
return true; return true;
} }
return true;
}
@override @override
bool get wantKeepAlive => widget.focusNode.hasFocus; bool get wantKeepAlive => widget.focusNode.hasFocus;

Loading…
Cancel
Save