How do I open a web browser (URL) from my Flutter code?

前端 未结 7 1737
时光说笑
时光说笑 2020-12-14 05:12

I am building a Flutter app, and I\'d like to open a URL into a web browser or browser window (in response to a button tap). How can I do this?

7条回答
  •  半阙折子戏
    2020-12-14 06:07

    If you want to use url_launcher than please use it in this form

    environment:
      sdk: ">=2.1.0 <3.0.0"
    
    dependencies:
      url_launcher: ^5.0.2
      flutter:
        sdk: flutter
    

    This answer is also for absolute beginners: They are thinking behind the flutter sdk. No that was a failure. The packages were extras and not in the flutter Sdk. These were secondary packages (single small framework helpers).

提交回复
热议问题