Home > OS >  How to Navigate to Website from App in flutter?
How to Navigate to Website from App in flutter?

Time:10-31

I want to navigate to playstore when user click on button Like

ElevatedButton(onPressed:(){Navigtor.of(context)},child:Text("Navigate to website"),)

I don't want to use any plugin like webview_flutter.

I don't Know how to achieve this. If you know the solution then answer this question

CodePudding user response:

You can use launch_review library which used to open any url you want, and if you want to open in the app or in browser depends on the link you provides.
e.g to open Facebook in the app, use url like :

fb://page/115931433433385?referrer=app_link (Android)

or normal url to open in browser

https://www.facebook.com/trynketsapp

webview_flutter will open the link in your app as its browser, but this library will open it in another app. Unless this is not what your're looking for

CodePudding user response:

use url_launcher package

void _launchURL() async => await canLaunch(_url) ? await launch(_url) : throw 'Could not launch $_url'; where the _url is your web link

  • Related