In short, do this, it might help:
Html links:
<a href="tg:resolve?domain=YourId">Telegram (YourId)</a>
<a href="mailto:you@example.com">Email (you@example.com)</a>
Flutter:
import 'package:webview_flutter/webview_flutter.dart';
import 'package:url_launcher/url_launcher.dart';
// ...
WebView(
initialUrl: 'https://example.com',
navigationDelegate: (NavigationRequest request) {
if (request.url.contains("mailto:")) {
canLaunchUrl(Uri(
scheme: 'mailto', path: 'you@example.com'))
.then((bool result) {
launchUrl(
Uri(scheme: 'mailto', path: 'you@example.com'),
mode: LaunchMode.externalApplication,
);
});
return NavigationDecision.prevent;
} else if (request.url.contains("tg:")) { // TELEGRAM
canLaunchUrl(
Uri(scheme: 'tg', path: 'resolve?domain=YourId'))
.then((bool result) {
launchUrl(
Uri(scheme: 'tg', path: 'resolve?domain=YourId'),
mode: LaunchMode.externalApplication,
);
});
return NavigationDecision.prevent;
}
return NavigationDecision.navigate;
},
),
// ...