URL Launcher Package Flutter

Flutter Queen✨
3 min readApr 15, 2023

--

A Flutter plugin for launching a URL. You can add many URLs to your app to launch any site. For example flutter.dev, medium.com, LinkedIn, behance.net, github.com, and more.

Preview

Import the dependency in your pubspec.yaml file .

Add IOS and Android permission tags.

IOS:

Android:

Create a variable in which you pass the URL of which site you want to display on the screen. I have created two-variable because I am launching two sites.

I have added some dummy code and network images like this. You add your own.

Now create a function in which you launch the site in your app. I have created an Elevated Button and passed the function to it.

The function must be async because it will perform future actions. launchUrl is getting from the url_launcher package to launch URL sites to the screens.

Same for the Text Button but different variable which consisting different URL. The function must be async because it will perform future actions. launchUrl is getting from the url_launcher package to launch URL sites to the screens.

Now hot restart your app and BOOM!

Go through the documentation: Docs

I hope this article was helpful to you. Thank you for taking the time to read it. Your feedback and suggestions are always welcome.

Support Me:

--

--

Flutter Queen✨
Flutter Queen✨

Written by Flutter Queen✨

Flutter Enthusiast | Software Engineer to be

No responses yet