A WebView2-powered Flutter WebView implementation for the Windows platform.

Overview

webview_windows

CI Pub

A Flutter WebView plugin for Windows built on Microsoft Edge WebView2.

Target platform requirements

Development platform requirements

  • Visual Studio 2019
  • Windows 10 SDK 1903+ (10.0.18362.1)

Demo

image

webview_demo1.mp4

Limitations

This plugin provides seamless composition of web-based contents with other Flutter widgets by rendering off-screen.

Unfortunately, Microsoft Edge WebView2 doesn't currently have an explicit API for offscreen rendering. In order to still be able to obtain a pixel buffer upon rendering a new frame, this plugin currently relies on the Windows.Graphics.Capture API provided by Windows 10. The downside is that older Windows versions aren't currently supported.

Older Windows versions might still be targeted by using BitBlt for the time being.

See:

Comments
  • Not able to load html and js content from assets

    Not able to load html and js content from assets

    First of all,Thanks for the great package. I have issue while loading web content,I have html and js file in assets folder,

    1. though I am able to load html content, Js file is't working using (loadStringContent function),
    2. Also communication between dart and html js is't working and vice versa.

    If the feature is implemented please provide example for each cases, if not I hope this feature will come soon

    opened by CodingWithTashi 13
  • CMake Error at flutter/ephemeral/.plugin_symlinks/webview_windows/windows/CMakeLists.txt:32

    CMake Error at flutter/ephemeral/.plugin_symlinks/webview_windows/windows/CMakeLists.txt:32

    it happend when i use webview_windows: ^0.1.4

    Building Windows application... CMake Error at flutter/ephemeral/.plugin_symlinks/webview_windows/windows/CMakeLists.txt:32 (message): Integrity check for D:/Android/Projects/publish_player/build/windows/nuget.exe failed

    Exception: Unable to generate build files

    Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.18363.1556], locale zh-CN) [√] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.9) [√] Android Studio (version 2020.3) [√] Connected device (2 available)

    opened by TOKID 12
  • Error: does not contain a CMakeLists.txt file.

    Error: does not contain a CMakeLists.txt file.

    flutter-webview-windows/example/windows/flutter/ephemeral/.plugin_symlinks/webview_windows/windows/third_party/fmt

    does not contain a CMakeLists.txt file.

    opened by kechankrisna 11
  • App Crashes on Windows

    App Crashes on Windows

    webview_windows_plugin.dll make crashes my app only on certain Windows. I insalled webview2 and windows version is more than Windows 10 1809+. Any idea? EDIT: Its seem that depends on build and version of windows. For example on windows 10 home version 21h2 app crashes. In windows 11 or windows 10 (version 10.0.18363 build 18363) doesn't crash.

    opened by matteotoma98 10
  • Read HTML from webview

    Read HTML from webview

    Is it possiable read html when page finished ?

    We implement the same function on flutter_webview

    return WebView(
     ...
        onPageFinished: (result) async {
          String html =
          (await _mobileWebViewController!.evaluateJavascript(
              "window.document.getElementsByTagName('html')[0].outerHTML;"));
          //read(html);
        },
     ...
    }
    

    Thanks~

    opened by dodatw 9
  • execute script not returning string

    execute script not returning string

    Please Make the executeScript method with returing String

    _controller.executeScript('''
                      document.getElementById('MessageDisplay_TABLE').textContent;
      ''').then((vgt) {
    print(vgt);
    });
    
    opened by venky9885 7
  • Null safety error &

    Null safety error & "Not Initialized" on screen.

    Hi there! I've been trying to get this plugin to work but cannot. I'm trying to build example app.

    Exception:

    [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: LateInitializationError: Field '_methodChannel@18215898' has not been initialized.
    #0      WebviewController._methodChannel (package:webview_windows/webview_windows.dart)
    #1      WebviewController.loadUrl (package:webview_windows/webview_windows.dart:205:11)
    #2      _MyAppState.initPlatformState (package:app/main.dart:39:23)
    

    flutter doctor

    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 2.2.1, on Microsoft Windows [Version 10.0.19042.572], locale en-US)
    [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        ✗ Android license status unknown.
          Run `flutter doctor --android-licenses` to accept the SDK licenses.
          See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
    [✓] Chrome - develop for the web
    [✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.6)
    [✓] Android Studio (version 3.6)
    [✓] VS Code (version 1.56.2)
    [✓] Connected device (3 available)
    

    Further information I'm on latest Windows SDK.

    Thanks a lot. Please help me out. 🙏

    opened by alexmercerind 7
  • Browser may not be secure when authenticating via google

    Browser may not be secure when authenticating via google

    Hi! Amazing Package! thankyou!

    Im trying to use this package to implement an oauth flow. After users are redirected to google auth. google informs that the browser may not be secure and does not let the user log in.

    https://user-images.githubusercontent.com/76003859/146657999-86f94b54-6f59-4d9b-95b5-af8bca8df1ee.mp4

    Hopefully the attachment is good enuff to show what i mean.

    P.S. How do i close the webview? _controller.dispose() ?

    opened by AhyaanTech 6
  • Unable to run with the defined setup in readme.

    Unable to run with the defined setup in readme.

    First of all thanks to this huge effort and great pacakage.

    Currently I am unable to run even after following the minimal amount of information in Readme.

    • I have set up the nuget.exe in path and is available.
    • I have installed the webview2 runtime
    • My windows version is 1909

    Still following error is shown without much details. I tried flutter clean and also git init submodule && git update submodule as mentioned in issue #3 .

    C:\Abhilash\Sources\dashboard\dashboard_frontend\windows\flutter\ephemeral\.plugin_symlinks\webview_windows\windows\util/capture.desktop.interop.h(4,10): fatal error C1083: Cannot open include file: 'windows.graphics.capture.interop.h': No such file or directory [C:\Abhilash\Sources\dashboard\dashboard_frontend\build\windows\plugins\webview_windows\webview_windows_plugin.vcxproj]
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\cppwinrt\winrt/base.h(6508,17): error C2220: the following warning is treated as an error [C:\Abhilash\Sources\dashboard\dashboard_frontend\build\windows\plugins\webview_windows\webview_windows_plugin.vcxproj]
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\cppwinrt\winrt/base.h(6508,17): warning C5205: delete of an abstract class 'winrt::impl::implements_delegate<winrt::Windows::UI::Core::DispatchedHandler,H>' that has a non-virtual destructor results in undefined behavior [C:\Abhilash\Sources\dashboard\dashboard_frontend\build\windows\plugins\webview_windows\webview_windows_plugin.vcxproj]
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\cppwinrt\winrt/base.h(6508,17): error C2220: the following warning is treated as an error [C:\Abhilash\Sources\dashboard\dashboard_frontend\build\windows\plugins\webview_windows\webview_windows_plugin.vcxproj]
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\cppwinrt\winrt/base.h(6508,17): warning C5205: delete of an abstract class 'winrt::impl::implements_delegate<winrt::Windows::UI::Core::DispatchedHandler,H>' that has a non-virtual destructor results in undefined behavior [C:\Abhilash\Sources\dashboard\dashboard_frontend\build\windows\plugins\webview_windows\webview_windows_plugin.vcxproj]
    C:\Abhilash\Sources\dashboard\dashboard_frontend\windows\flutter\ephemeral\.plugin_symlinks\webview_windows\windows\util/capture.desktop.interop.h(4,10): fatal error C1083: Cannot open include file: 'windows.graphics.capture.interop.h': No such file or directory [C:\Abhilash\Sources\dashboard\dashboard_frontend\build\windows\plugins\webview_windows\webview_windows_plugin.vcxproj]
    C:\Abhilash\Sources\dashboard\dashboard_frontend\windows\flutter\ephemeral\.plugin_symlinks\webview_windows\windows\util/capture.desktop.interop.h(4,10): fatal error C1083: Cannot open include file: 'windows.graphics.capture.interop.h': No such file or directory [C:\Abhilash\Sources\dashboard\dashboard_frontend\build\windows\plugins\webview_windows\webview_windows_plugin.vcxproj]
    
    flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel stable, 2.0.6, on Microsoft Windows [Version 10.0.18363.1441], locale de-DE)
    [√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    [√] Chrome - develop for the web
    [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.6)
    [√] Android Studio (version 4.1.0)
    [√] VS Code (version 1.56.1)
    [√] Connected device (3 available)
    
    • No issues found!
    
    opened by Abhilash-Chandran 6
  • [Compiling Error] The compiler feature

    [Compiling Error] The compiler feature "cxx_std_23" is not known to CXX compiler

    Brand new project, added the package and sample.

    This is the output when I try flutter run

    Launching lib\main.dart on Windows in debug mode...
    lib\main.dart:1
    CMake Error at flutter/ephemeral/.plugin_symlinks/webview_windows/windows/CMakeLists.txt:77 (target_compile_features):
      target_compile_features The compiler feature "cxx_std_23" is not known to
      CXX compiler
    
      "MSVC"
    
      version 19.29.30140.0.
    
    
    Exception: Unable to generate build files
    Exited (sigterm)
    

    This package used to work before 0.2.2

    The Readme says that a new sdk for windows 11 is required, I downloaded the SDK installer from here https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/ and installed in my machine successfully. I rebooted, did a flutter clean and pub get, tried flutter run again, same error.

    This is my output for flutter doctor

    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel stable, 3.3.2, on Microsoft Windows [Version 10.0.19044.2006], locale en-CA)
    [√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)  
    [√] Chrome - develop for the web
    [√] Visual Studio - develop for Windows (Visual Studio Professional 2019 16.11.10)
    [√] Android Studio (version 2021.2)
    [√] VS Code (version 1.71.2)
    [√] Connected device (3 available)
    [√] HTTP Host Availability
    
    • No issues found!
    

    If I rollback to fixed version "0.2.1" it works again.

    Any help? Thanks!

    opened by nosmirck 5
  • Getting value of inner html from webview into dart (as a string).

    Getting value of inner html from webview into dart (as a string).

    Hello,

    Is there a way in which I can get the value of a text element in the web page (self-hosted) as a dart String?

    So far I have only found executeScript which returns Future thereby making it incapable of doing this. Also, there isn't a Javascript channel like what we have in webview_flutter (for IOS and Android) which could also facilitate this two-way communication. Thanks in advance.

    opened by Ingenious-c0der 5
Owner
Niklas Schulze
Niklas Schulze
Enduro/X Middleware Platform for Distributed Transaction Processing

endurox Build (including atmi/ubf tests) status OS Status OS Status OS Status AIX 7.1 Centos 6 FreeBSD 11 Oracle Linux 7 OSX 11.4 raspbian10_arv7l SLE

Mavimax, Ltd 137 Dec 20, 2022
The application framework for developer module of EdgeGallery platform

crane-framework crane-framework将可复用的计算和软件功能抽象成插件,APP开发者面向使用插件进行MEC APP开发。这样屏蔽了和MEC平台交互的细节,实现MCE APP和MEC平台的松耦合。而且插件框架基础能力可裁剪,按需提供最小的APP系统。 特性介绍 为了方便开发者

EdgeGallery 21 Aug 30, 2021
Drogon: A C++14/17 based HTTP web application framework running on Linux/macOS/Unix/Windows

English | 简体中文 | 繁體中文 Overview Drogon is a C++14/17-based HTTP application framework. Drogon can be used to easily build various types of web applicat

An Tao 8.5k Dec 31, 2022
✔️The smallest header-only GUI library(4 KLOC) for all platforms

Welcome to GUI-lite The smallest header-only GUI library (4 KLOC) for all platforms. 中文 Lightweight ✂️ Small: 4,000+ lines of C++ code, zero dependenc

null 6.6k Jan 8, 2023
Ultra-lightweight web browser based on Qt Ultralight webview, powered by Ultralight HTML renderer

Qt Ultralight Browser This is an ultra-lightweight web browser powered by the Ultralight web engine embedded in Qt 5 app as a custom webview widget -

niu tech 43 Jan 7, 2023
A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs.

webview for golang and c/c++ A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. The goal of the project is to

polevpn 21 Dec 3, 2022
A flutter plugin that runs a wayland compositor to stream textures onto flutter, allows creation of wayland based shells using flutter

flcompositor A new flutter plugin project. Getting Started This project is a starting point for a Flutter plug-in package, a specialized package that

Davide Bianco 3 Jan 10, 2022
Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Nim bindings, Haskell, C# bindings and Java bindings available.

webview 10.8k Jan 9, 2023
A Zig binding to the webview library. Make Zig applications with a nice HTML5 frontend a reality!

A Zig binding to the webview library. Make Zig applications with a nice HTML5 frontend a reality!

ZigLibs 52 Dec 29, 2022
A simple library that helps Android developers to execute JavaScript code from Android native side easily without using Webview.

AndroidJSModule A simple library that helps Android developers to execute JavaScript code from Android native side easily without using Webview. Insta

Hung Nguyen 5 May 24, 2022
A Flutter package that makes it easy to customize and work with your Flutter desktop app's system tray.

system_tray A Flutter package that that enables support for system tray menu for desktop flutter apps. on Windows, macOS and Linux. Features: - Modify

AnTler 140 Dec 30, 2022
A flutter package for making game levels map like candy crush or similar games using flutter with ability to be horizontal or vertical

Game Levels Scrolling Map A package for making game levels map like candy crush or similar games using flutter with ability to be horizontal or vertic

Mohamed Sayed 12 Oct 26, 2022
Flutter-Clock-and-Reminder-App - a highly functional clock and reminder app developed on flutter framework.

clock_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

Umar Baloch 6 Aug 4, 2022
A cross-platform (Android/iOS/Windows/macOS) cronet plugin for Flutter via `dart:ffi`

cronet_flutter A cross-platform (Android/iOS/Windows/macOS) cronet plugin for Flutter via dart:ffi

null 25 Dec 11, 2022
Free, cross-platform 2D game engine powered by Haxe and OpenFL

flixel | addons | ui | demos | tools | templates | docs | haxeflixel.com Links Here are the most important links to get you started with HaxeFlixel: G

HaxeFlixel 1.7k Dec 30, 2022
Cutter is a free and open-source reverse engineering platform powered by rizin

Cutter is a free and open-source reverse engineering platform powered by rizin. It aims at being an advanced and customizable reverse engineering platform while keeping the user experience in mind. Cutter is created by reverse engineers for reverse engineers.

Rizin Organization 12.4k Jan 1, 2023
A keystone engine powered Windows Debugger extension

DbgKeystone A Keystone engine powered Windows Debugger extension Reasoning WinDbg's default assember (the a command) can't handle instructions involvi

Michael B. 12 Nov 9, 2022
A cross-platform flutter plugin for C/C++/ObjC crash report via Google Breakpad

quick_breakpad A cross-platform flutter plugin for C/C++/ObjC crash report via Google Breakpad Use breakpad for quick_breakpad_example $CLI_BREAKPAD i

Woodemi Co., Ltd 16 Jul 30, 2022