mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: could not open link without scheme
This commit is contained in:
parent
886c1f00e5
commit
1cd9a77e00
@ -277,7 +277,13 @@ class RichTextStyle {
|
||||
if (href != null) {
|
||||
return TapGestureRecognizer()
|
||||
..onTap = () async {
|
||||
await launchUrlString(href);
|
||||
final uri = Uri.parse(href);
|
||||
// url_launcher cannot open a link without scheme.
|
||||
final newHref =
|
||||
(uri.scheme.isNotEmpty ? href : 'http://$href').trim();
|
||||
if (await canLaunchUrlString(newHref)) {
|
||||
await launchUrlString(newHref);
|
||||
}
|
||||
};
|
||||
}
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user