Dreta / desktop-webview-window

Cross-platform desktop webview for Flutter [MixinNetwork/flutter-plugins]

Home Page:https://github.com/MixinNetwork/flutter-plugins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

desktop_webview_window

Pub

Show a webview window on your flutter desktop application.

Windows Webview2 1.0.992.28
Linux WebKitGTK-4.1
macOS WKWebview

Getting Started

  1. modify your main method.

    import 'package:desktop_webview_window/desktop_webview_window.dart';
    
    void main() async {
      WidgetsFlutterBinding.ensureInitialized();
      
      // Add this your main method.
      // used to show a webview title bar.
      if (runWebViewTitleBarWidget(args)) {
        return;
      }
    
      runApp(MyApp());
    }
    
  2. launch WebViewWindow

      final webview = await WebviewWindow.create();
      webview.launch("https://example.com");

linux requirement

sudo apt-get install webkit2gtk-4.1

Windows requirement

The backend of desktop_webview_window on Windows is WebView2, which requires WebView2 Runtime installed.

WebView2 Runtime is ship in box with Windows11, but it may not installed on Windows10 devices. So you need consider how to distribute the runtime to your users.

See more: https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution

For convenience, you can use WebviewWindow.isWebviewAvailable() check whether the WebView2 is available.

License

see LICENSE

About

Cross-platform desktop webview for Flutter [MixinNetwork/flutter-plugins]

https://github.com/MixinNetwork/flutter-plugins

License:Apache License 2.0


Languages

Language:C++ 64.6%Language:C 31.7%Language:Dart 1.4%Language:Swift 1.2%Language:CMake 0.9%Language:HTML 0.1%Language:Ruby 0.1%Language:Shell 0.0%