handleMethodCall method

Future handleMethodCall(
  1. MethodCall call
)

Implementation

Future<dynamic> handleMethodCall(MethodCall call) async {
  switch (call.method) {
    case 'installApp':
      final String? jsonString = call.arguments;
      if (jsonString is String) {
        Map map = json.decode(jsonString);
        final url = _urlFromMap(map);
        if (url != null) return _launch(url);
      }
      throw PlatformException(
        code: 'Invalid parameters',
        details: 'A json string containing required parameters is required.',
      );
    default:
      throw PlatformException(
          code: 'Unimplemented',
          details: "The url_launcher plugin for web doesn't implement "
              "the method '${call.method}'");
  }
}