Exploring Webviews and the Url Launcher Plugin in Dart's Flutter Framework

in #utopian-io6 years ago (edited)

What Will I Learn?

  • You will learn how to make use of the URL launcher plugin
  • You will learn how to interact and interface with the webview API from flutter
  • You will learn how to use the Flutter Webview Plugin plugin
  • You will learn how to interact with HTML documents with flutter

Requirements

Difficulty

  • Intermediate

Description

In this Flutter video tutorial, we look at the Google's URL launcher plugin and a third party plugin called Flutter WebView Plugin. Both of these plugins let us interact with web pages and HTML content. The URL launcher lets us launch a URL into a browser on both iOS and Android as well as embed the URL into a WebView on either platform. The URL launcher can also create intents to open email clients, phone clients and message clients using different URL schemes.

The URL launcher plugin uses a function called canLaunch to check to see if the device can handle the URL scheme. If you try to open a phone number scheme on a tablet, for instance, then this function will return false. We are then able to specify how we want the application to handle opening the URL. We can do this by giving it the ability to open the URL inside of the app by way of the WebView API on android and the iOS UIWebView. Android by default opens URLs in a browser where as iOS will open these URLs in the application; by modifying this behavior using the URL launcher, we can make it consistent across the two platforms. The downside to opening a WebView using the URL launcher is that we have to modify the WebView client from the native code to allow it to access certain features.

The Flutter WebView Plugin on the other hand gives us a solution that allows us to interface directly with the native WebView plugins on both iOS and Android. We enable features like JavaScript, caching and local storage directly from our flutter layer without having to modify the native code. The Flutter WebView Plugin also features some nice extensions such as a zoom widget, and the ability to change how our application scheme will be presented to the end user. We can create various widgets that sit on top of the native WebView with this plugin.

The source code for this project can be found here

Video Tutorial

Curriculum



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Thank you again for moderating my contribution.

Hey @redart, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

Hey @tensor I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 64118.79
ETH 3390.14
USDT 1.00
SBD 2.51