mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: set mouse cursor style to text when hovering on the text node
This commit is contained in:
parent
27ea5a11a9
commit
6dcf3b3fa7
@ -35,7 +35,7 @@ class FlowyRichText extends StatefulWidget {
|
|||||||
this.cursorHeight,
|
this.cursorHeight,
|
||||||
this.cursorWidth = 2.0,
|
this.cursorWidth = 2.0,
|
||||||
this.textSpanDecorator,
|
this.textSpanDecorator,
|
||||||
this.placeholderText = 'Type \'/\' for commands',
|
this.placeholderText = ' ',
|
||||||
this.placeholderTextSpanDecorator,
|
this.placeholderTextSpanDecorator,
|
||||||
required this.textNode,
|
required this.textNode,
|
||||||
required this.editorState,
|
required this.editorState,
|
||||||
@ -138,11 +138,16 @@ class _FlowyRichTextState extends State<FlowyRichText> with Selectable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildRichText(BuildContext context) {
|
Widget _buildRichText(BuildContext context) {
|
||||||
return Stack(
|
return MouseRegion(
|
||||||
|
cursor: SystemMouseCursors.text,
|
||||||
|
child: widget.textNode.toRawString().isEmpty
|
||||||
|
? Stack(
|
||||||
children: [
|
children: [
|
||||||
_buildPlaceholderText(context),
|
_buildPlaceholderText(context),
|
||||||
_buildSingleRichText(context),
|
_buildSingleRichText(context),
|
||||||
],
|
],
|
||||||
|
)
|
||||||
|
: _buildSingleRichText(context),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user