Skip to content

Commit 9c5081b

Browse files
committed
chore: enable the richtext widget as large as parent
1 parent cdfe94c commit 9c5081b

File tree

1 file changed

+9
-11
lines changed
  • frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/url_cell

1 file changed

+9
-11
lines changed

frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/url_cell/url_cell.dart

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,18 @@ class _GridURLCellState extends State<GridURLCell> {
7171
fontSize: 14,
7272
decoration: TextDecoration.underline,
7373
),
74-
recognizer: _tapGesture(context),
7574
),
7675
);
7776

78-
return Align(alignment: Alignment.centerLeft, child: richText);
77+
return SizedBox.expand(
78+
child: GestureDetector(
79+
child: Align(alignment: Alignment.centerLeft, child: richText),
80+
onTap: () async {
81+
widget.onFocus.value = true;
82+
final url = context.read<URLCellBloc>().state.url;
83+
await _openUrlOrEdit(url);
84+
},
85+
));
7986
},
8087
),
8188
);
@@ -94,15 +101,6 @@ class _GridURLCellState extends State<GridURLCell> {
94101
super.didUpdateWidget(oldWidget);
95102
}
96103

97-
TapGestureRecognizer _tapGesture(BuildContext context) {
98-
final gesture = TapGestureRecognizer();
99-
gesture.onTap = () async {
100-
final url = context.read<URLCellBloc>().state.url;
101-
await _openUrlOrEdit(url);
102-
};
103-
return gesture;
104-
}
105-
106104
Future<void> _openUrlOrEdit(String url) async {
107105
final uri = Uri.parse(url);
108106
if (url.isNotEmpty && await canLaunchUrl(uri)) {

0 commit comments

Comments
 (0)