Skip to content

Instantly share code, notes, and snippets.

@defensive-wizard
Created September 21, 2021 06:54
Show Gist options
  • Save defensive-wizard/cd81900def5e4cc50b2d0c77fca54c76 to your computer and use it in GitHub Desktop.
Save defensive-wizard/cd81900def5e4cc50b2d0c77fca54c76 to your computer and use it in GitHub Desktop.
example of url launcher
Future<Null> _launchInBrowser(String url) async {
if (await canLaunch(url)) {
await launch(url, forceSafariVC: false, forceWebView: false);
} else {
throw 'Could not launch $url';
}
}
// or
IconButton(
icon:Icon(Icons.open_in_browser)
onPressed:() => launch("https://flutter.dev")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment