Mar 24, 2023

CCoSVG

I fixed the repository link to work on the deployed site.

url_launcher_web seems to be installed when url_lancher is installed, and work as a plugin for web-app platform, but didn't work on the yesterday's deployed site. Edge WebTools displayed the following error message.

Uncaught MissingPluginException(No implementation found for method canLaunch on channel plugins.flutter.io/url_launcher

I changed to use the plugin object directly to avoid the problem.

final url = Uri.parse('https://github.com/lpubsppop01/ccosvg');
if (kIsWeb) {
  // Use the plugin object directly because it didn't work as a plugin in the deployed site
  var plugin = UrlLauncherPlugin();
  if (await plugin.canLaunch(url.toString())) {
    await plugin.launch(url.toString());
  }
} else if (await canLaunchUrl(url)) {
  await launchUrl(url);
}

References: