Always use text cursor for editor on desktop (#1264)

pull/1267/head
Benjamin Quinn 2 years ago committed by GitHub
parent 9d877478ad
commit 0906f71b53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      example/lib/pages/home_page.dart
  2. 6
      lib/src/widgets/raw_editor.dart

@ -158,9 +158,7 @@ class _HomePageState extends State<HomePage> {
}
Widget _buildWelcomeEditor(BuildContext context) {
Widget quillEditor = MouseRegion(
cursor: SystemMouseCursors.text,
child: QuillEditor(
Widget quillEditor = QuillEditor(
controller: _controller!,
scrollController: ScrollController(),
scrollable: true,
@ -192,12 +190,9 @@ class _HomePageState extends State<HomePage> {
...FlutterQuillEmbeds.builders(),
NotesEmbedBuilder(addEditNote: _addEditNote)
],
),
);
if (kIsWeb) {
quillEditor = MouseRegion(
cursor: SystemMouseCursors.text,
child: QuillEditor(
quillEditor = QuillEditor(
controller: _controller!,
scrollController: ScrollController(),
scrollable: true,
@ -226,8 +221,7 @@ class _HomePageState extends State<HomePage> {
embedBuilders: [
...defaultEmbedBuildersWeb,
NotesEmbedBuilder(addEditNote: _addEditNote),
]),
);
]);
}
var toolbar = QuillToolbar.basic(
controller: _controller!,

@ -461,6 +461,8 @@ class RawEditorState extends EditorState
Widget child = CompositedTransformTarget(
link: _toolbarLayerLink,
child: Semantics(
child: MouseRegion(
cursor: SystemMouseCursors.text,
child: _Editor(
key: _editorKey,
document: _doc,
@ -480,6 +482,7 @@ class RawEditorState extends EditorState
children: _buildChildren(_doc, context),
),
),
),
);
if (widget.scrollable) {
@ -499,6 +502,8 @@ class RawEditorState extends EditorState
physics: widget.scrollPhysics,
viewportBuilder: (_, offset) => CompositedTransformTarget(
link: _toolbarLayerLink,
child: MouseRegion(
cursor: SystemMouseCursors.text,
child: _Editor(
key: _editorKey,
offset: offset,
@ -520,6 +525,7 @@ class RawEditorState extends EditorState
),
),
),
),
);
}

Loading…
Cancel
Save