How to add a Webview in Flutter?












9















I know its possible to add a WebView as a full page but couldn't find any sample code to do it. I assume you could use a PageView as it's base but not sure how to call the native android WebView and add it to the PageView.



Can anyone point me in the right direction?










share|improve this question



























    9















    I know its possible to add a WebView as a full page but couldn't find any sample code to do it. I assume you could use a PageView as it's base but not sure how to call the native android WebView and add it to the PageView.



    Can anyone point me in the right direction?










    share|improve this question

























      9












      9








      9


      1






      I know its possible to add a WebView as a full page but couldn't find any sample code to do it. I assume you could use a PageView as it's base but not sure how to call the native android WebView and add it to the PageView.



      Can anyone point me in the right direction?










      share|improve this question














      I know its possible to add a WebView as a full page but couldn't find any sample code to do it. I assume you could use a PageView as it's base but not sure how to call the native android WebView and add it to the PageView.



      Can anyone point me in the right direction?







      android flutter






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 27 '17 at 13:11









      Donny V.Donny V.

      9,67295269




      9,67295269
























          4 Answers
          4






          active

          oldest

          votes


















          10














          Flutter doesn't have built-in support for embedded WebViews. Follow issue 730 for updates.



          You can still show web content in your app, but you'll have to leave Flutter-land using the plugin system.



          If you just want to open a browser, you can use the url_launcher Flutter plugin.



          If you want to do something fancier (perhaps you don't want a visible address bar), you could implement a custom UIViewController (iOS example) and Activity (Android example) and use the plugin API to launch into these.






          share|improve this answer





















          • 1





            Haven't used this, but it might be doing just that: pub.dartlang.org/packages/flutter_webview_plugin

            – Randal Schwartz
            Jun 22 '17 at 15:10











          • Yes, that's a good option.

            – Collin Jackson
            Jun 22 '17 at 15:11



















          9














          You can use https://pub.dartlang.org/packages/webview_flutter



          example



          import 'package:webview_flutter/webview_flutter.dart';

          return Scaffold(
          appBar: AppBar(
          title: const Text('Flutter WebView example'),
          ),
          body: const WebView(
          initialUrl: 'https://flutter.io',
          javascriptMode: JavascriptMode.unrestricted,
          ),
          );





          share|improve this answer


























          • This is probably the one to go for, sadly it´s still in developer preview.

            – 最白目
            Dec 12 '18 at 19:58











          • Important: The keyboard will not display on Android (see issue #19718). This is a showstopper if you're trying to use this for OAuth. If you need this functionality, please vote on the issue and perhaps it will be re-prioritized to be fixed sooner than its current milestone of October 2019.

            – Matt
            Mar 17 at 7:56





















          3














          webview plugin works well, however it will be created over the top of every single bit of your app so you will have to add additional logic to show and hide the plugin. You can show it full screen or as a sized rectangle.



          https://pub.dartlang.org/packages/flutter_webview_plugin






          share|improve this answer

































            0














            You can use the below dart plugin to display the Webview.Also, you can find dart plugin from this url: https://pub.dartlang.org/packages/flutter_webview_plugin



            new MaterialApp(
            routes: {
            "/": (_) => new WebviewScaffold(
            url: "https://www.google.com",
            appBar: new AppBar(
            title: new Text("Widget webview"),
            ),
            ),
            },
            );





            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43658910%2fhow-to-add-a-webview-in-flutter%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              10














              Flutter doesn't have built-in support for embedded WebViews. Follow issue 730 for updates.



              You can still show web content in your app, but you'll have to leave Flutter-land using the plugin system.



              If you just want to open a browser, you can use the url_launcher Flutter plugin.



              If you want to do something fancier (perhaps you don't want a visible address bar), you could implement a custom UIViewController (iOS example) and Activity (Android example) and use the plugin API to launch into these.






              share|improve this answer





















              • 1





                Haven't used this, but it might be doing just that: pub.dartlang.org/packages/flutter_webview_plugin

                – Randal Schwartz
                Jun 22 '17 at 15:10











              • Yes, that's a good option.

                – Collin Jackson
                Jun 22 '17 at 15:11
















              10














              Flutter doesn't have built-in support for embedded WebViews. Follow issue 730 for updates.



              You can still show web content in your app, but you'll have to leave Flutter-land using the plugin system.



              If you just want to open a browser, you can use the url_launcher Flutter plugin.



              If you want to do something fancier (perhaps you don't want a visible address bar), you could implement a custom UIViewController (iOS example) and Activity (Android example) and use the plugin API to launch into these.






              share|improve this answer





















              • 1





                Haven't used this, but it might be doing just that: pub.dartlang.org/packages/flutter_webview_plugin

                – Randal Schwartz
                Jun 22 '17 at 15:10











              • Yes, that's a good option.

                – Collin Jackson
                Jun 22 '17 at 15:11














              10












              10








              10







              Flutter doesn't have built-in support for embedded WebViews. Follow issue 730 for updates.



              You can still show web content in your app, but you'll have to leave Flutter-land using the plugin system.



              If you just want to open a browser, you can use the url_launcher Flutter plugin.



              If you want to do something fancier (perhaps you don't want a visible address bar), you could implement a custom UIViewController (iOS example) and Activity (Android example) and use the plugin API to launch into these.






              share|improve this answer















              Flutter doesn't have built-in support for embedded WebViews. Follow issue 730 for updates.



              You can still show web content in your app, but you'll have to leave Flutter-land using the plugin system.



              If you just want to open a browser, you can use the url_launcher Flutter plugin.



              If you want to do something fancier (perhaps you don't want a visible address bar), you could implement a custom UIViewController (iOS example) and Activity (Android example) and use the plugin API to launch into these.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jul 29 '18 at 13:31









              Duncan Jones

              45.2k16116174




              45.2k16116174










              answered Apr 27 '17 at 22:28









              Collin JacksonCollin Jackson

              27.2k48996




              27.2k48996








              • 1





                Haven't used this, but it might be doing just that: pub.dartlang.org/packages/flutter_webview_plugin

                – Randal Schwartz
                Jun 22 '17 at 15:10











              • Yes, that's a good option.

                – Collin Jackson
                Jun 22 '17 at 15:11














              • 1





                Haven't used this, but it might be doing just that: pub.dartlang.org/packages/flutter_webview_plugin

                – Randal Schwartz
                Jun 22 '17 at 15:10











              • Yes, that's a good option.

                – Collin Jackson
                Jun 22 '17 at 15:11








              1




              1





              Haven't used this, but it might be doing just that: pub.dartlang.org/packages/flutter_webview_plugin

              – Randal Schwartz
              Jun 22 '17 at 15:10





              Haven't used this, but it might be doing just that: pub.dartlang.org/packages/flutter_webview_plugin

              – Randal Schwartz
              Jun 22 '17 at 15:10













              Yes, that's a good option.

              – Collin Jackson
              Jun 22 '17 at 15:11





              Yes, that's a good option.

              – Collin Jackson
              Jun 22 '17 at 15:11













              9














              You can use https://pub.dartlang.org/packages/webview_flutter



              example



              import 'package:webview_flutter/webview_flutter.dart';

              return Scaffold(
              appBar: AppBar(
              title: const Text('Flutter WebView example'),
              ),
              body: const WebView(
              initialUrl: 'https://flutter.io',
              javascriptMode: JavascriptMode.unrestricted,
              ),
              );





              share|improve this answer


























              • This is probably the one to go for, sadly it´s still in developer preview.

                – 最白目
                Dec 12 '18 at 19:58











              • Important: The keyboard will not display on Android (see issue #19718). This is a showstopper if you're trying to use this for OAuth. If you need this functionality, please vote on the issue and perhaps it will be re-prioritized to be fixed sooner than its current milestone of October 2019.

                – Matt
                Mar 17 at 7:56


















              9














              You can use https://pub.dartlang.org/packages/webview_flutter



              example



              import 'package:webview_flutter/webview_flutter.dart';

              return Scaffold(
              appBar: AppBar(
              title: const Text('Flutter WebView example'),
              ),
              body: const WebView(
              initialUrl: 'https://flutter.io',
              javascriptMode: JavascriptMode.unrestricted,
              ),
              );





              share|improve this answer


























              • This is probably the one to go for, sadly it´s still in developer preview.

                – 最白目
                Dec 12 '18 at 19:58











              • Important: The keyboard will not display on Android (see issue #19718). This is a showstopper if you're trying to use this for OAuth. If you need this functionality, please vote on the issue and perhaps it will be re-prioritized to be fixed sooner than its current milestone of October 2019.

                – Matt
                Mar 17 at 7:56
















              9












              9








              9







              You can use https://pub.dartlang.org/packages/webview_flutter



              example



              import 'package:webview_flutter/webview_flutter.dart';

              return Scaffold(
              appBar: AppBar(
              title: const Text('Flutter WebView example'),
              ),
              body: const WebView(
              initialUrl: 'https://flutter.io',
              javascriptMode: JavascriptMode.unrestricted,
              ),
              );





              share|improve this answer















              You can use https://pub.dartlang.org/packages/webview_flutter



              example



              import 'package:webview_flutter/webview_flutter.dart';

              return Scaffold(
              appBar: AppBar(
              title: const Text('Flutter WebView example'),
              ),
              body: const WebView(
              initialUrl: 'https://flutter.io',
              javascriptMode: JavascriptMode.unrestricted,
              ),
              );






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jan 31 at 4:26









              Nicodemuz

              1,38711424




              1,38711424










              answered Dec 5 '18 at 7:38









              Shyju MadathilShyju Madathil

              1,3201120




              1,3201120













              • This is probably the one to go for, sadly it´s still in developer preview.

                – 最白目
                Dec 12 '18 at 19:58











              • Important: The keyboard will not display on Android (see issue #19718). This is a showstopper if you're trying to use this for OAuth. If you need this functionality, please vote on the issue and perhaps it will be re-prioritized to be fixed sooner than its current milestone of October 2019.

                – Matt
                Mar 17 at 7:56





















              • This is probably the one to go for, sadly it´s still in developer preview.

                – 最白目
                Dec 12 '18 at 19:58











              • Important: The keyboard will not display on Android (see issue #19718). This is a showstopper if you're trying to use this for OAuth. If you need this functionality, please vote on the issue and perhaps it will be re-prioritized to be fixed sooner than its current milestone of October 2019.

                – Matt
                Mar 17 at 7:56



















              This is probably the one to go for, sadly it´s still in developer preview.

              – 最白目
              Dec 12 '18 at 19:58





              This is probably the one to go for, sadly it´s still in developer preview.

              – 最白目
              Dec 12 '18 at 19:58













              Important: The keyboard will not display on Android (see issue #19718). This is a showstopper if you're trying to use this for OAuth. If you need this functionality, please vote on the issue and perhaps it will be re-prioritized to be fixed sooner than its current milestone of October 2019.

              – Matt
              Mar 17 at 7:56







              Important: The keyboard will not display on Android (see issue #19718). This is a showstopper if you're trying to use this for OAuth. If you need this functionality, please vote on the issue and perhaps it will be re-prioritized to be fixed sooner than its current milestone of October 2019.

              – Matt
              Mar 17 at 7:56













              3














              webview plugin works well, however it will be created over the top of every single bit of your app so you will have to add additional logic to show and hide the plugin. You can show it full screen or as a sized rectangle.



              https://pub.dartlang.org/packages/flutter_webview_plugin






              share|improve this answer






























                3














                webview plugin works well, however it will be created over the top of every single bit of your app so you will have to add additional logic to show and hide the plugin. You can show it full screen or as a sized rectangle.



                https://pub.dartlang.org/packages/flutter_webview_plugin






                share|improve this answer




























                  3












                  3








                  3







                  webview plugin works well, however it will be created over the top of every single bit of your app so you will have to add additional logic to show and hide the plugin. You can show it full screen or as a sized rectangle.



                  https://pub.dartlang.org/packages/flutter_webview_plugin






                  share|improve this answer















                  webview plugin works well, however it will be created over the top of every single bit of your app so you will have to add additional logic to show and hide the plugin. You can show it full screen or as a sized rectangle.



                  https://pub.dartlang.org/packages/flutter_webview_plugin







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Aug 28 '18 at 12:58

























                  answered May 24 '18 at 18:38









                  orangesherbertorangesherbert

                  3,79932853




                  3,79932853























                      0














                      You can use the below dart plugin to display the Webview.Also, you can find dart plugin from this url: https://pub.dartlang.org/packages/flutter_webview_plugin



                      new MaterialApp(
                      routes: {
                      "/": (_) => new WebviewScaffold(
                      url: "https://www.google.com",
                      appBar: new AppBar(
                      title: new Text("Widget webview"),
                      ),
                      ),
                      },
                      );





                      share|improve this answer




























                        0














                        You can use the below dart plugin to display the Webview.Also, you can find dart plugin from this url: https://pub.dartlang.org/packages/flutter_webview_plugin



                        new MaterialApp(
                        routes: {
                        "/": (_) => new WebviewScaffold(
                        url: "https://www.google.com",
                        appBar: new AppBar(
                        title: new Text("Widget webview"),
                        ),
                        ),
                        },
                        );





                        share|improve this answer


























                          0












                          0








                          0







                          You can use the below dart plugin to display the Webview.Also, you can find dart plugin from this url: https://pub.dartlang.org/packages/flutter_webview_plugin



                          new MaterialApp(
                          routes: {
                          "/": (_) => new WebviewScaffold(
                          url: "https://www.google.com",
                          appBar: new AppBar(
                          title: new Text("Widget webview"),
                          ),
                          ),
                          },
                          );





                          share|improve this answer













                          You can use the below dart plugin to display the Webview.Also, you can find dart plugin from this url: https://pub.dartlang.org/packages/flutter_webview_plugin



                          new MaterialApp(
                          routes: {
                          "/": (_) => new WebviewScaffold(
                          url: "https://www.google.com",
                          appBar: new AppBar(
                          title: new Text("Widget webview"),
                          ),
                          ),
                          },
                          );






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jan 3 at 4:36









                          GoogleGoogle

                          1,2851639




                          1,2851639






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43658910%2fhow-to-add-a-webview-in-flutter%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              generate and download xml file after input submit (php and mysql) - JPK

                              Angular Downloading a file using contenturl with Basic Authentication

                              Can't read property showImagePicker of undefined in react native iOS