onSchemaHandlerTap function
Implementation
Future<void> onSchemaHandlerTap({
required String url,
void Function(String)? onException,
}) async {
LaunchMode mode = LaunchMode.externalApplication;
if (url.contains("tg:") || await canLaunchUrl(Uri.parse(url))) {
try {
await launchUrl(
Uri.parse(url),
mode: mode,
);
} catch (e) {
if (onException != null) {
onException('Could not launch the URL: $url');
} else {
log('Could not launch the URL: $url');
}
}
}
}