In react or html when you hover over a link element like this:
Example Link
The browser shows a tooltip of the url at the bottom left of the browser.
Is there any way to achieve this in flutter?
I tried this in flutter and the url tooltip never shows up at the bottom left:
import 'package:flutter/material.dart';
import 'package:flutter_custom_tabs/flutter_custom_tabs.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
class Link extends StatelessWidget {
const Link({
super.key,
required this.urlLabel,
required this.url,
});
final String urlLabel;
final String url;
Future<void> _launchUrl(String url) async {
final Uri uri = Uri.parse(url);
launchUrl(uri);
}
@override
Widget build(BuildContext context) {
return MarkdownBody(
data: '[$urlLabel]($url)',
onTapLink: (text, href, title) async {
if (href != null) {
await _launchUrl(href);
}
},
);
}
}