mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: The click area of the linked text is too large.
This commit is contained in:
parent
42866e1057
commit
e567158cee
@ -46,10 +46,13 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
extendBodyBehindAppBar: true,
|
extendBodyBehindAppBar: true,
|
||||||
body: Container(
|
body: Center(
|
||||||
|
child: Container(
|
||||||
|
width: 780,
|
||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
child: _buildEditor(context),
|
child: _buildEditor(context),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
floatingActionButton: _buildExpandableFab(),
|
floatingActionButton: _buildExpandableFab(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -32,10 +32,8 @@ class EditorNodeWidget extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Column(
|
||||||
color: Colors.red.withOpacity(0.1),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: node.children
|
children: node.children
|
||||||
.map(
|
.map(
|
||||||
(child) =>
|
(child) =>
|
||||||
@ -54,7 +52,6 @@ class EditorNodeWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,8 +56,8 @@ class _BulletedListTextNodeWidgetState extends State<BulletedListTextNodeWidget>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return SizedBox(
|
return Container(
|
||||||
width: defaultMaxTextNodeWidth,
|
constraints: BoxConstraints(maxWidth: defaultMaxTextNodeWidth),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.only(bottom: defaultLinePadding),
|
padding: EdgeInsets.only(bottom: defaultLinePadding),
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -70,14 +70,14 @@ class _BulletedListTextNodeWidgetState extends State<BulletedListTextNodeWidget>
|
|||||||
padding: EdgeInsets.only(right: _iconRightPadding),
|
padding: EdgeInsets.only(right: _iconRightPadding),
|
||||||
name: 'point',
|
name: 'point',
|
||||||
),
|
),
|
||||||
Expanded(
|
Flexible(
|
||||||
child: FlowyRichText(
|
child: FlowyRichText(
|
||||||
key: _richTextKey,
|
key: _richTextKey,
|
||||||
placeholderText: 'List',
|
placeholderText: 'List',
|
||||||
textNode: widget.textNode,
|
textNode: widget.textNode,
|
||||||
editorState: widget.editorState,
|
editorState: widget.editorState,
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -86,7 +86,7 @@ class _CheckboxNodeWidgetState extends State<CheckboxNodeWidget>
|
|||||||
..commit();
|
..commit();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Expanded(
|
Flexible(
|
||||||
child: FlowyRichText(
|
child: FlowyRichText(
|
||||||
key: _richTextKey,
|
key: _richTextKey,
|
||||||
placeholderText: 'To-do',
|
placeholderText: 'To-do',
|
||||||
|
@ -194,7 +194,9 @@ class _FlowyRichTextState extends State<FlowyRichText> with Selectable {
|
|||||||
return RichText(
|
return RichText(
|
||||||
key: _textKey,
|
key: _textKey,
|
||||||
textHeightBehavior: const TextHeightBehavior(
|
textHeightBehavior: const TextHeightBehavior(
|
||||||
applyHeightToFirstAscent: false, applyHeightToLastDescent: false),
|
applyHeightToFirstAscent: false,
|
||||||
|
applyHeightToLastDescent: false,
|
||||||
|
),
|
||||||
text: widget.textSpanDecorator != null
|
text: widget.textSpanDecorator != null
|
||||||
? widget.textSpanDecorator!(textSpan)
|
? widget.textSpanDecorator!(textSpan)
|
||||||
: textSpan,
|
: textSpan,
|
||||||
|
@ -63,8 +63,8 @@ class _HeadingTextNodeWidgetState extends State<HeadingTextNodeWidget>
|
|||||||
top: _topPadding,
|
top: _topPadding,
|
||||||
bottom: defaultLinePadding,
|
bottom: defaultLinePadding,
|
||||||
),
|
),
|
||||||
child: SizedBox(
|
child: Container(
|
||||||
width: defaultMaxTextNodeWidth,
|
constraints: BoxConstraints(maxWidth: defaultMaxTextNodeWidth),
|
||||||
child: FlowyRichText(
|
child: FlowyRichText(
|
||||||
key: _richTextKey,
|
key: _richTextKey,
|
||||||
placeholderText: 'Heading',
|
placeholderText: 'Heading',
|
||||||
|
@ -70,7 +70,7 @@ class _NumberListTextNodeWidgetState extends State<NumberListTextNodeWidget>
|
|||||||
padding: EdgeInsets.only(right: _iconRightPadding),
|
padding: EdgeInsets.only(right: _iconRightPadding),
|
||||||
number: widget.textNode.attributes.number,
|
number: widget.textNode.attributes.number,
|
||||||
),
|
),
|
||||||
Expanded(
|
Flexible(
|
||||||
child: FlowyRichText(
|
child: FlowyRichText(
|
||||||
key: _richTextKey,
|
key: _richTextKey,
|
||||||
placeholderText: 'List',
|
placeholderText: 'List',
|
||||||
|
@ -69,7 +69,7 @@ class _QuotedTextNodeWidgetState extends State<QuotedTextNodeWidget>
|
|||||||
padding: EdgeInsets.only(right: _iconRightPadding),
|
padding: EdgeInsets.only(right: _iconRightPadding),
|
||||||
name: 'quote',
|
name: 'quote',
|
||||||
),
|
),
|
||||||
Expanded(
|
Flexible(
|
||||||
child: FlowyRichText(
|
child: FlowyRichText(
|
||||||
key: _richTextKey,
|
key: _richTextKey,
|
||||||
placeholderText: 'Quote',
|
placeholderText: 'Quote',
|
||||||
|
@ -52,8 +52,8 @@ class _RichTextNodeWidgetState extends State<RichTextNodeWidget>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return SizedBox(
|
return Container(
|
||||||
width: defaultMaxTextNodeWidth,
|
constraints: BoxConstraints(maxWidth: defaultMaxTextNodeWidth),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.only(bottom: defaultLinePadding),
|
padding: EdgeInsets.only(bottom: defaultLinePadding),
|
||||||
child: FlowyRichText(
|
child: FlowyRichText(
|
||||||
|
@ -238,6 +238,12 @@ void showLinkMenu(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _dismissLinkMenu() {
|
void _dismissLinkMenu() {
|
||||||
|
// workaround: SelectionService has been released after hot reload.
|
||||||
|
final isSelectionDisposed =
|
||||||
|
_editorState?.service.selectionServiceKey.currentState == null;
|
||||||
|
if (isSelectionDisposed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (_editorState?.service.selectionService.currentSelection.value == null) {
|
if (_editorState?.service.selectionService.currentSelection.value == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user