I am trying open a link on Google pixel API 30 Emulator but keep on getting error. Have tried flutter clean, restarted app.
Dependency:-
url_launcher: ^6.0.3
Code:-
InkWell(
onTap:() => _launchURL("https://google.com"),
child: Image.asset("assets/images/googleIcon.jpg")
),
_launchURL(String url) async {
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
Error:-
Unhandled Exception: Could not launch https://google.com