Flutter : Launch Url

This Article is posted by shubham.narkhede8 at 11/26/2019 4:57:07 PM



<p>color: rgb(51, 51, 51); font-family: "Open Sans", Helvetica, Arial, sans-serif;](In this tutorial, we’ll learn how we can launch a url in flutter mobile applications. color: rgb(51, 51, 51); font-family: "Open Sans", Helvetica, Arial, sans-serif;](For this we can use a flutter package called color: rgb(51, 51, 51); font-family: "Open Sans", Helvetica, Arial, sans-serif;](First we need to create a new Flutter Project and then we will add our plugin into the pubspec.yaml file.color: rgb(51, 51, 51); font-family: "Open Sans", Helvetica, Arial, sans-serif;]( hljs-attrmargin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; font-size: 12.96px; line-height: inherit; font-family: "Lucida Console", Monaco, monospace; vertical-align: baseline; color: rgb(152, 104, 1); white-space: pre-wrap;](dependenciescolor: rgb(56, 58, 66); font-family: "Lucida Console", Monaco, monospace; font-size: 12.96px; white-space: pre-wrap; background-color: rgb(250, 250, 250);](:hljs-stringmargin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; font-size: 12.96px; line-height: inherit; font-family: "Lucida Console", Monaco, monospace; vertical-align: baseline; color: rgb(80, 161, 79); white-space: pre-wrap;](color: rgb(56, 58, 66); font-family: "Lucida Console", Monaco, monospace; font-size: 12.96px; white-space: pre-wrap; background-color: rgb(250, 250, 250);]( hljs-attrmargin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; font-size: 12.96px; line-height: inherit; font-family: "Lucida Console", Monaco, monospace; vertical-align: baseline; color: rgb(152, 104, 1); white-space: pre-wrap;](fluttercolor: rgb(56, 58, 66); font-family: "Lucida Console", Monaco, monospace; font-size: 12.96px; white-space: pre-wrap; background-color: rgb(250, 250, 250);](:hljs-stringmargin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; font-size: 12.96px; line-height: inherit; font-family: "Lucida Console", Monaco, monospace; vertical-align: baseline; color: rgb(80, 161, 79); white-space: pre-wrap;](color: rgb(56, 58, 66); font-family: "Lucida Console", Monaco, monospace; font-size: 12.96px; white-space: pre-wrap; background-color: rgb(250, 250, 250);]( hljs-attrmargin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; font-size: 12.96px; line-height: inherit; font-family: "Lucida Console", Monaco, monospace; vertical-align: baseline; color: rgb(152, 104, 1); white-space: pre-wrap;](sdkcolor: rgb(56, 58, 66); font-family: "Lucida Console", Monaco, monospace; font-size: 12.96px; white-space: pre-wrap; background-color: rgb(250, 250, 250);](: hljs-stringmargin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; font-size: 12.96px; line-height: inherit; font-family: "Lucida Console", Monaco, monospace; vertical-align: baseline; color: rgb(80, 161, 79); white-space: pre-wrap;](fluttercolor: rgb(56, 58, 66); font-family: "Lucida Console", Monaco, monospace; font-size: 12.96px; white-space: pre-wrap; background-color: rgb(250, 250, 250);](</p> <p>hljs-attrmargin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; font-size: 12.96px; line-height: inherit; font-family: "Lucida Console", Monaco, monospace; vertical-align: baseline; color: rgb(152, 104, 1); white-space: pre-wrap;](url_launchercolor: rgb(56, 58, 66); font-family: "Lucida Console", Monaco, monospace; font-size: 12.96px; white-space: pre-wrap; background-color: rgb(250, 250, 250);](: hljs-stringmargin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; font-size: 12.96px; line-height: inherit; font-family: "Lucida Console", Monaco, monospace; vertical-align: baseline; color: rgb(80, 161, 79); white-space: pre-wrap;](^5.2.7 color: rgb(51, 51, 51); font-family: "Open Sans", Helvetica, Arial, sans-serif;](First to open website url into your app you need to create a method with website url.color: rgb(51, 51, 51); font-family: "Open Sans", Helvetica, Arial, sans-serif;]( myUrl() async { const url = 'https://www.google.com/maps/@18.8154265,76.7751435,7z'; if (await canLaunch(url)) { await launch(url); } else { throw 'Could not launch $url'; } }color: rgb(51, 51, 51); font-family: "Open Sans", Helvetica, Arial, sans-serif;]( color: rgb(51, 51, 51); font-family: "Open Sans", Helvetica, Arial, sans-serif;](we’ve created a method named myUrlcolor: rgb(51, 51, 51); font-family: "Open Sans", Helvetica, Arial, sans-serif;]( and inside this method we’ve written the code for opening the google map in the browser.color: rgb(51, 51, 51); font-family: "Open Sans", Helvetica, Arial, sans-serif;]( color: rgb(51, 51, 51); font-family: "Open Sans", Helvetica, Arial, sans-serif;](Call this method on onPress of buttoncolor: rgb(51, 51, 51); font-family: "Open Sans", Helvetica, Arial, sans-serif;]( ](](](](](](](](](</p>


Tags: flutter; dart; android; ios; appbar; flutterUi; Stateless, Stateful, widgets








1 Comments
Login to comment.
Recent Comments

walidja2009 at 12/9/2019

Thankx great easy cleary to understand usefull quickly bref amazing .....

Login to Reply.