FLUTTER WEBVIEW TUTORIAL #4 - Convert a website to an app using flutter.
Tags: flutter, android, techwithsam, tutorial
Published: 2021-03-05 09:32:25

### Hi 👋, everyone and welcome to part four of the flutter webview tutorial series. 



Today, we’re going to learn the fourth example on how to convert a website into an app in a few minutes using Flutter. If you want to know more about some cogent flutter Tricks and Tips and How to achieve tasks easily in Flutter, consider following me so you don’t miss any updates and subscribing to my [YouTube Channel](https://www.youtube.com/c/TechWithSam?sub_confirmation=1). Thanks


**Check the video out for more explanation and part three article** 👇

{% youtube Sk-0fMj5MiU %}

### PART THREE ARTICLE
{% link https://dev.to/techwithsam/flutter-webview-tutorial-3-convert-a-website-to-an-app-using-flutter-2kgk %}

# Let get started

We're still using the [flutter_inappwebview](https://pub.dev/packages/flutter_inappwebview) package, so just create another dart file for example 4, you can name it **WebExampleFour**.

The example is pretty straightforward, we just need some methods and parameters just like the code below

```
import 'package:flutter_inappwebview/flutter_inappwebview.dart';

class WebExampleFour extends ChromeSafariBrowser {

  @override
  void onOpened() {}

  @override
  void onCompletedInitialLoad() {}

  @override
  void onClosed() {}
}
```

And don't forget to import the flutter_appwebview library 

```
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
```

And that's all for the **WebExampleFour** page you can now move to the homepage.dart file or any page you want your user to click the button to navigate to the **WebExampleFour** page.

So on the homepage, we just have to declare a final variable for **WebExampleFour** and that's all

```
final WebExampleFour inAppChrome = WebExampleFour();
```

Then, on button pressed
```
              MaterialButton(
                onPressed: () {
                  inAppChrome.open(
                          url: 'https://obounce.net',
                          options: ChromeSafariBrowserClassOptions(
                              android: AndroidChromeCustomTabsOptions(),
                              ios: IOSSafariOptions()));
                },
                child: Text(
                  'Example 4',
                  style: TextStyle(color: Colors.white),
                ),
                color: Colors.pink[900],
                padding: EdgeInsets.symmetric(horizontal: 70, vertical: 12),
              ),
```

And that's all the major stuff you need to know 👌,  For more explanation kindly check the video tutorial.

{% youtube Sk-0fMj5MiU %}

Source Code 👇 - Show some ❤️ by starring ⭐ the repo and do follow me 😄!

{% github techwithsam/flutter_webview %}

I hope you have learned one thing or the other, kindly give this article much appreciation you want if you enjoy it, feel free to ask a question and leave a comment if you feel like it 🤭. Thanks for reading and see you in the next series.

🔗 Let's Connect 🔗 --> [Github](https://github.com/techwithsam) | [Twitter](https://twitter.com/techwithsam_) | [Youtube](https://www.youtube.com/c/TechWithSam?sub_confirmation=1) | [WhatsApp](https://wa.me/message/JLGQNNTPG64IH1) | [LinkedIn](https://linkedin.com/in/techwithsam) | [Patreon](https://www.patreon.com/acctgen1) | [Facebook](https://facebook.com/techwithsam).

Join the Flutter Dev Community 👨‍💻👨‍💻 ==> [Facebook](https://www.facebook.com/groups/flutterdevsgroup/) | [Telegram](https://t.me/flutterdevsgroup) | [WhatsApp](https://chat.whatsapp.com/Cns1jo7dc5dCNrg6aG44My) | [Signal](https://signal.group/#CjQKILccbSu9GnMF_qVrkdCFVQ_i2gmnigPDvweCy86JGpL3EhBg39kp1rftGQgZDYXLty7t).

Subscribe to my [Telegram channel](https://t.me/acctgen) | [Youtube channel](https://www.youtube.com/c/TechWithSam?sub_confirmation=1). Thanks

**Happy Fluttering** 🥰👨‍💻