Skip to content

Instantly share code, notes, and snippets.

@chinmaygarde
Created June 22, 2016 17:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chinmaygarde/d778498418e30825d687147b79d070eb to your computer and use it in GitHub Desktop.
Save chinmaygarde/d778498418e30825d687147b79d070eb to your computer and use it in GitHub Desktop.
Example usage of connecting to the URI launcher and launching a URI.
import 'package:flutter/services.dart'; // for shell
import 'package:sky_services/flutter/platform/uri_launcher.mojom.dart' as mojo;
static mojo.UriLauncherProxy _initLauncherService() =>
shell.connectToApplicationService(
mojo.UriLauncher.serviceName,
mojo.UriLauncher.connectToService);
static mojo.UriLauncherProxy _launcherService = _initLauncherService();
void launchURI() {
Future.wait(<Future<bool>>[_launcherService.launch("http://flutter.io")]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment