mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-09-26 17:03:05 +00:00
fix: canLaunchUrl doesn't work with Flatpak (#7796)
This commit is contained in:
parent
65b7916a6a
commit
0cdecee771
@ -44,10 +44,18 @@ Future<bool> afLaunchUri(
|
|||||||
uri = Uri.parse('https://$url');
|
uri = Uri.parse('https://$url');
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to launch the uri directly
|
/// opening an incorrect link will cause a system error dialog to pop up on macOS
|
||||||
bool result = await launcher.canLaunchUrl(uri);
|
/// only use [canLaunchUrl] on macOS
|
||||||
|
/// and there is an known issue with url_launcher on Linux where it fails to launch
|
||||||
|
/// see https://github.com/flutter/flutter/issues/88463
|
||||||
|
bool result = true;
|
||||||
|
if (UniversalPlatform.isMacOS) {
|
||||||
|
result = await launcher.canLaunchUrl(uri);
|
||||||
|
}
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
try {
|
try {
|
||||||
|
// try to launch the uri directly
|
||||||
result = await launcher.launchUrl(
|
result = await launcher.launchUrl(
|
||||||
uri,
|
uri,
|
||||||
mode: mode,
|
mode: mode,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user