| 123456789101112131415161718192021222324 |
- import 'package:url_launcher/url_launcher.dart';
- /// UrlLauncher工具类
- class UrlLauncherUtil {
- /// 打开微信
- static Future<bool> openWeChat() async {
- const url = 'weixin://';
- return openUrl(url);
- }
- /// 打开iOS系统键盘设置页
- static openIosSystemKeyboardPage() {
- const url = 'App-Prefs:root=General&path=Keyboard';
- return openUrl(url);
- }
- /// 打开Url
- static Future<bool> openUrl(String url) async {
- if (!await launchUrl(Uri.parse(url))) {
- return Future.value(false);
- }
- return Future.value(true);
- }
- }
|