Skip to content

Commit 764414c

Browse files
committed
Replace deprecated use of launch
It is now replaced by `launchUrl` or `launchUrlString`.
1 parent a3e0c2f commit 764414c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/common/tools.dart

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ import 'dart:io';
33
import 'package:http/http.dart' as http;
44
import 'package:path_provider/path_provider.dart';
55
import 'package:permission_handler/permission_handler.dart';
6-
import 'package:url_launcher/url_launcher.dart';
6+
import 'package:url_launcher/url_launcher_string.dart';
77

88
void launchURL(String url) async {
9-
if (await canLaunch(url)) {
10-
await launch(url);
9+
if (await canLaunchUrlString(url)) {
10+
await launchUrlString(
11+
url,
12+
mode: LaunchMode.externalApplication,
13+
);
1114
} else {
1215
throw Exception('Could not launch $url');
1316
}

0 commit comments

Comments
 (0)