Replace deprecated canLaunch and launch
This commit is contained in:
parent
428ecbdc3d
commit
097199c4f1
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue