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/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.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 {
|
class Utils {
|
||||||
/// Minimum size (width or height) of a interactive component
|
/// Minimum size (width or height) of a interactive component
|
||||||
|
@ -158,8 +158,8 @@ class Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
static launchUrl(String url, BuildContext context) async {
|
static launchUrl(String url, BuildContext context) async {
|
||||||
if (await canLaunch(url)) {
|
if (await canLaunchUrlString(url)) {
|
||||||
await launch(url);
|
await launchUrlString(url);
|
||||||
} else {
|
} else {
|
||||||
Utils.popError(context, 'Error', 'Could not launch web view');
|
Utils.popError(context, 'Error', 'Could not launch web view');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue