Replace deprecated canLaunch and launch

This commit is contained in:
Ian VanSchooten 2024-08-28 14:59:32 -04:00
parent 428ecbdc3d
commit 097199c4f1
1 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ import 'package:file_picker/file_picker.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';
class Utils {
/// Minimum size (width or height) of a interactive component
@ -158,8 +158,8 @@ class Utils {
}
static launchUrl(String url, BuildContext context) async {
if (await canLaunch(url)) {
await launch(url);
if (await canLaunchUrlString(url)) {
await launchUrlString(url);
} else {
Utils.popError(context, 'Error', 'Could not launch web view');
}