Created
July 16, 2021 12:48
-
-
Save ketan-glitch/d31a6bff83f6da7721868a933115f77d to your computer and use it in GitHub Desktop.
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<void> _launchWebsite(String url) async { | |
if (!(url.startsWith('http'))) { | |
if (!(url.startsWith('https://'))) { | |
url = 'https://' + url; | |
} | |
} | |
if (await canLaunch(url)) { | |
await launch( | |
url, | |
forceSafariVC: false, | |
forceWebView: false, | |
// headers: <String, String>{'my_header_key': 'my_header_value'}, | |
); | |
} else { | |
print('Could not launch $url'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment