launchInApp static method

Future<bool> launchInApp(
  1. String url
)

WebView打开url url 跳转的url https://flutter.cn 若不支持WebView则返回false

Implementation

static Future<bool> launchInApp(String url) async {
  // 是否支持浏览器打开,支持则打开,不支持则抛出异常
  if (!await onCanLaunchUrl(url)) return false;
  return await launchUrlString(url, mode: LaunchMode.inAppWebView);
}