canLaunch function Null safety

Future<bool> canLaunch(
  1. String urlString
)

Checks whether the specified URL can be handled by some app installed on the device.

On Android (from API 30), canLaunch will return false when the required visibility configuration is not provided in the AndroidManifest.xml file. For more information see the Managing package visibility article in the Android docs.

Implementation

Future<bool> canLaunch(String urlString) async {
  return await UrlLauncherPlatform.instance.canLaunch(urlString);
}