canLaunch function

Future<bool> canLaunch (String urlString)

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

Implementation

Future<bool> canLaunch(String urlString) async {
  if (urlString == null) {
    return false;
  }
  // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter.
  // https://github.com/flutter/flutter/issues/26431
  // ignore: strong_mode_implicit_dynamic_method
  return await _channel.invokeMethod(
    'canLaunch',
    <String, Object>{'url': urlString},
  );
}