Current setup (using launch)
I want to use links in my Flutter web app and currently do it like this (using the url_launcher package):
return MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () {
launch('https://creativemaybeno.dev');
},
child: const Text(
'my amazing link',
style: TextStyle(
decoration: TextDecoration.underline,
),
),
),
);
What works using launch
There are three things that this code snippet does right:
- Fully works on mobile
- Shows click cursor on hover on web
- Opens the link on web in most cases
What does not work using launch
However, there are a number of issues I have with this on web compared to using an <a> anchor element in regular HTML:
- Link preview is not shown in the bottom-left corner of the browser.
This is what it looks like on regular HTML pages:
Links seem to be opening more slowly than the ones in regular web apps
Safari blocks my links completely ("blocked a pop-up")
Especially the links not working on Safari as well as the link preview not showing I really need to get resolved in order to have a smooth web experience. How do I achieve that?
