mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: enable the richtext widget as large as parent
This commit is contained in:
parent
cdfe94cf98
commit
9c5081bc07
@ -71,11 +71,18 @@ class _GridURLCellState extends State<GridURLCell> {
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
recognizer: _tapGesture(context),
|
||||
),
|
||||
);
|
||||
|
||||
return Align(alignment: Alignment.centerLeft, child: richText);
|
||||
return SizedBox.expand(
|
||||
child: GestureDetector(
|
||||
child: Align(alignment: Alignment.centerLeft, child: richText),
|
||||
onTap: () async {
|
||||
widget.onFocus.value = true;
|
||||
final url = context.read<URLCellBloc>().state.url;
|
||||
await _openUrlOrEdit(url);
|
||||
},
|
||||
));
|
||||
},
|
||||
),
|
||||
);
|
||||
@ -94,15 +101,6 @@ class _GridURLCellState extends State<GridURLCell> {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
}
|
||||
|
||||
TapGestureRecognizer _tapGesture(BuildContext context) {
|
||||
final gesture = TapGestureRecognizer();
|
||||
gesture.onTap = () async {
|
||||
final url = context.read<URLCellBloc>().state.url;
|
||||
await _openUrlOrEdit(url);
|
||||
};
|
||||
return gesture;
|
||||
}
|
||||
|
||||
Future<void> _openUrlOrEdit(String url) async {
|
||||
final uri = Uri.parse(url);
|
||||
if (url.isNotEmpty && await canLaunchUrl(uri)) {
|
||||
|
Loading…
Reference in New Issue
Block a user