Created
September 21, 2021 06:54
-
-
Save defensive-wizard/cd81900def5e4cc50b2d0c77fca54c76 to your computer and use it in GitHub Desktop.
example of url launcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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