Adding WebView to your Flutter app

Поділитися
Вставка
  • Опубліковано 4 жов 2024
  • Learn the ins and outs of using WebView in a Flutter application. Discover how to display widgets on top of a webview, how to respond to events like page loads, how to block websites using a navigation delegate, and even a technique for handling callbacks from JavaScript.
    Resource:
    Adding WebView to your Flutter app codelab → goo.gle/3j8wszq
    Speaker: Andrew Brogdon
    Watch more:
    All Google I/O 2022 Sessions → goo.gle/IO22_A...
    Flutter at I/O 2022 playlist → goo.gle/IO22_F...
    All Google I/O 2022 workshops → goo.gle/IO22_W...
    Subscribe to Flutter! → goo.gle/FlutterYT
    #GoogleIO

КОМЕНТАРІ • 76

  • @sslaia
    @sslaia 2 роки тому +16

    The fun fact he mentioned in the beginning is really smart. Something worth to include in every manager training. Thank you Andrew.

  • @user-eh5wo8re3d
    @user-eh5wo8re3d 2 роки тому +19

    Damn, really got my hopes up that WebView was available on Desktop now...

  • @pixelotetm
    @pixelotetm 2 роки тому +1

    This Boss, is the best ! I loved his Honesty Lol.😂😂

  • @duduoverburn1777
    @duduoverburn1777 2 роки тому

    BEST WEBVIEW tutorial EVER.

  • @tikivega3703
    @tikivega3703 Рік тому +1

    i liked the intro, get your production team.

  • @ironmans234
    @ironmans234 Рік тому +1

    Thanks sir
    I love you 3000❤

  • @gauravkumar-bs3pf
    @gauravkumar-bs3pf 11 місяців тому +1

    Hi sir, can I use this webview in web, for example: in windows or in macOS?

  • @ihsanbacha6436
    @ihsanbacha6436 21 день тому

    thank you very much sir

  • @bpraia
    @bpraia Рік тому +3

    It would be nice to update the tutorial to the new version of webview_flutter

  • @appnest4948
    @appnest4948 2 роки тому +1

    Excellent video. Andrew's videos really inspired to walk into app development in Flutter.
    Many I know who own small companies and they don't have budget for or simply they don't want to go for app development, where they invested significantly on web. They prefer to maintain web content only.
    Are there restrictions from Google in simply packing corporate website into an app and host it in playstore?

  • @jayhasmukhparmar3167
    @jayhasmukhparmar3167 Рік тому +1

    can you please tell me how to pass context inside NavigationDelegate? i want to perform routing from web to statfull widget

  • @joed8805
    @joed8805 2 роки тому +2

    Why does webview in Flutter start with around 120 MB of memory usage with no major code and using latest webview_flutter plugin, when compared to WKWebview which uses only around 40 MB. Please reply or at least check it.

  • @GermanVarela-r5o
    @GermanVarela-r5o 10 місяців тому

    Thanks so much!

  • @mycloudvip
    @mycloudvip Рік тому

    Amazing work! great content! Can you provide a video on handling three.js externally onto a WebView and interact with it using a layered button on top of the external HTML page. Thanks

  • @sammybutt5895
    @sammybutt5895 2 роки тому +6

    you cant get access to local storage with webview...
    kindly work on this as well

    • @andrewbrogdon558
      @andrewbrogdon558 2 роки тому +2

      Hmm. We had an issue about this a while ago (github.com/flutter/flutter/issues/26133), but I thought it had been fixed. If you're running into a problem, please file an issue at github.com/flutter/flutter/issues!

  • @MrCamdere
    @MrCamdere 2 роки тому +1

    my website has a page loader also and when im trying to load the website in the app that loads and loads and my website are not visible ?

  • @ismailakbas5665
    @ismailakbas5665 2 роки тому +1

    Thank you

    • @flutterdev
      @flutterdev  2 роки тому +1

      Glad you enjoyed this, Ismail 😃
      If you're interested in additional resources, be sure to check out the codelab here:
      goo.gle/3j8wszq

  • @wptuhoc3904
    @wptuhoc3904 Рік тому +1

    In the webview, we can download file, image, video,... And we can upload the avatar image, file or pdf,... So, you can guide me and anyone to do it

  • @sksahil4374
    @sksahil4374 20 днів тому

    In Android It is just the overly of java Android Webview on Flutter. Rendering from Java Android Surface Texture will be nice Using OpenGL. Or CEF implementation for Android.

  • @ГариГарибальди-ъ1я
    @ГариГарибальди-ъ1я 4 місяці тому

    How about desktop OS (Linux,Windows) support?

  • @BugGenerat0r
    @BugGenerat0r 2 роки тому

    Had a bit of hope that this video would discuss Webview on desktop. Alas...

  • @Joe-qv2jo
    @Joe-qv2jo 2 роки тому +1

    Why does Flutter web view start with 120 mb memory usage when Compared to WKWebview which takes only 40 mb. Hope this message is replied and not deleted.

  • @PraneshPyaraShrestha
    @PraneshPyaraShrestha 2 роки тому

    This is greatt

  • @roshsuresh4430
    @roshsuresh4430 2 роки тому +1

    How to download files from webview.. Pls give reply

  • @danielrocha5774
    @danielrocha5774 10 місяців тому

    I've an issue with embedded content. Every time I click it pop-ups ads. Is there a way to deal with it?

  • @hekimhsyn1436
    @hekimhsyn1436 2 роки тому +1

    Please 🙏🥺 can you answer my question ⁉️
    How I can set or change current device time in flutter app without go to device settings?

    • @redbrogdon
      @redbrogdon 2 роки тому +1

      On iOS, I don't think it's possible for any app to change the device clock, unfortunately. On Android, you could request the SET_TIME permission in your app's manifest and use Platform Channels to communicate with native code that calls the TimeManager API: developer.android.com/reference/com/google/android/things/device/TimeManager

  • @nurbekbatyrzhanuulu2957
    @nurbekbatyrzhanuulu2957 2 роки тому +1

    Does any one has idea, why WebViews initial opening of webview from middle of page?

  • @shohagsumon7933
    @shohagsumon7933 2 роки тому +1

    Sweet

    • @flutterdev
      @flutterdev  2 роки тому

      Thanks, Shohag! If you want to learn additional resources, check out the following link: goo.gle/3j8wszq

  • @yasin5603
    @yasin5603 Рік тому

    Hello, can I coding application with Javascript and html in flutter? without need url?

  • @ifnotgodtech
    @ifnotgodtech 2 роки тому

    Thanks for the tutorial. Pls how can we render a custom error page on network failure?

    • @flutterdev
      @flutterdev  2 роки тому +2

      Hey there! It's dependent on use case, but if there's an error when you're trying to pull an image, for example, you can give an errorBuilder to return the error page widget. api.flutter.dev/flutter/widgets/Image/errorBuilder.html

  • @husseinmansour1904
    @husseinmansour1904 2 роки тому

    Hello good job, but i copied everything and it did'nt work when it loaded it say in red background :"Unsupported operation: platfform_operatingSystem ".
    so Please Help

  • @pitocms
    @pitocms 2 роки тому +1

    Please give an example on file choose while uploading image in webview , it seems not working in this plugin.

  • @hawarhekmat1174
    @hawarhekmat1174 2 роки тому +2

    My question is if i have a ton of documents and fetch them with snapshot all of them, is listview builder is smart enough to fetch all of them without crashing my app and render what is visible on screen, thanks for great work

    • @BooleanDev
      @BooleanDev 2 роки тому +2

      only the items on screen will be rendered, but the rest data fetched will be in memory. Consider using packages such as loading_more_list or lazy_load_scrollview to load more items when scrolled to the bottom

    • @hawarhekmat1174
      @hawarhekmat1174 2 роки тому

      @@BooleanDev thanks, i will try.

    • @ranjithkumardasari8041
      @ranjithkumardasari8041 Рік тому

      is this working in real device

  • @brokercl
    @brokercl 6 місяців тому

    after follow this tutorial, the view beside don't recognize WebView, problems say Unused import: 'package:webview_flutter/webview_flutter.dart'.
    Try removing the import directive., Im go crazy

  • @fyanahmad9418
    @fyanahmad9418 2 роки тому +1

    does anyone know how to download files via flutter webview?

  • @下雨-v6g
    @下雨-v6g Рік тому

    使用stack 在webview上 添加导航,点击事件无效,怎么解决?

  • @ZeZeBatata69
    @ZeZeBatata69 2 роки тому +1

    Is WebView still not available in Desktop?

    • @redbrogdon
      @redbrogdon 2 роки тому

      Not the last time I checked. Now that the desktop platforms are stable, I'm hoping to see a lot more effort (both in and out of Google) going into making plugins support Linux, Windows, and macOS.

  • @izharhusain5605
    @izharhusain5605 Рік тому

    How to get the mime type when download is triggered

  • @126basavarajhiremath2
    @126basavarajhiremath2 2 роки тому +1

    no sir on real phone also icon are not visible video timing = 6:04

  • @poramatearayapreecha2264
    @poramatearayapreecha2264 Рік тому

    My error
    lib/main.dart:20:14: Error: Type 'WebViewController' not found.
    late final WebViewController controller;
    ^^^^^^^^^^^^^^^^^
    lib/main.dart:20:14: Error: 'WebViewController' isn't a type.
    late final WebViewController controller;
    ^^^^^^^^^^^^^^^^^
    lib/main.dart:25:18: Error: The method 'WebViewController' isn't defined for the class '_WebViewAppState'.
    - '_WebViewAppState' is from 'package:webview/main.dart' ('lib/main.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'WebViewController'.
    controller = WebViewController()

  • @rektgaming69
    @rektgaming69 Рік тому

    Hello
    I converted my website to app all the functionality is working but when I click on WhatsApp it shows me webpage error , Facebook & instagram are working fine . I search everywhere follow stackoverflow solutions but didn’t work do you know how to fix this error 😢

  • @pivotexpert9792
    @pivotexpert9792 2 роки тому +3

    I am highly interested to know if we can build a browser on top of chromium in flutter. If it is, How???
    Because we know webview can be good for regular use cases but chromium is way more powerful than that.
    I will be waiting for your response.

  • @chrisl2854
    @chrisl2854 2 роки тому

    The only problem I have with this is Flutter Web View is not updating url content. I have updated my page content on the website and will continue to do so but the WebViewer is not showing that change . I will need this to work on Android and IOS my app will be done if ever this gets to working right.

    • @wordwonders365
      @wordwonders365 Рік тому

      So the Flutter Web view doesn't reflect changes from your website automatically??? Is it not supposed to be syncing with the content of the website since it's loading from the url

  • @Cerberodev
    @Cerberodev 2 роки тому

    Hellow Dash’s !

  • @faizulla5838
    @faizulla5838 Рік тому

    HTML web site not opened it ... why???

  • @MiguelGarcia-pv7tz
    @MiguelGarcia-pv7tz 2 роки тому

    Hello, I have a question, when I switch from one page to another the state of my WebView isn't remembered and it reloads every time. how can prevent that? Thanks so much!

    • @nitinkumarahirwar5461
      @nitinkumarahirwar5461 Рік тому

      Hey! Did you find the ans for this? If yes please let me know!

    • @abderrazakkenniche2801
      @abderrazakkenniche2801 Рік тому

      Create a variable of ur webview rather than creating a new instance of your webview each time

  • @miguelolvera3546
    @miguelolvera3546 2 роки тому

    could facilitate the connection between mysql and flutter?

    • @craiglabenz9147
      @craiglabenz9147 2 роки тому

      To connect a Flutter app to MySQL, I recommend looking into popular backend frameworks like Express, Django, or some of the new full-stack Dart frameworks currently being announced.

  • @matiasosuna4278
    @matiasosuna4278 2 роки тому

    how do you make tests to ensure it's working properly?

    • @flutterdev
      @flutterdev  2 роки тому

      Hi Matias! We've included some information on how to test Flutter apps. Check it out here: goo.gle/3CWguCQ 😁

    • @matiasosuna4278
      @matiasosuna4278 Рік тому

      @@flutterdev Hi! I meant for webviews specificly

  • @ivomuze
    @ivomuze 2 роки тому

    The problem with webview is that you give access to the entire internet without even noticing, for example if some url goes to google and the phone is in a childs hands, it will bypass all the configurations of the web restritions is it not?

    • @andrewbrogdon558
      @andrewbrogdon558 2 роки тому +2

      You can implement your own NavigationDelegate (see 17:47 for an example) to prevent the WebView from navigating away from a specified domain!

  • @gabriel.coelhof
    @gabriel.coelhof Рік тому

    PIKA

  • @hdartru5620
    @hdartru5620 6 місяців тому

    TO INSTALL Flutter with outdated ways became the reason i hate and never recommend flutter.

  • @dotnetdevni
    @dotnetdevni Рік тому

    Microsoft could learn a few things from flutter online cotent long term ms developer feed up of there cross platform efforts in maul flutter happy path is far better

  • @brokercl
    @brokercl 5 місяців тому

    Launching lib/main.dart on SM G950F in debug mode...
    lib/app/modules/confirm_pay/views/confirm_pay_view.dart:17:19: Error: Couldn't find constructor 'WebView'.
    body: const WebView(
    ^^^^^^^
    Target kernel_snapshot failed: Exception

  • @VitorFThome
    @VitorFThome Рік тому +1

    Does anyone knows if this is still working on flutter 3?