Skip to main content

flet-webview-all

flet-webview-all is a Flet extension that embeds web content in a Flet application. It wraps webview_all, a Flutter WebView implementation with support for Android, iOS, Linux, macOS, Windows, and the web.

The control is a ft.LayoutControl, so it can use Flet layout properties such as expand, width, height, and visible.

Installation

Install the published package from PyPI:

pip install flet-webview-all

Or add it to your application's pyproject.toml:

[project]
dependencies = [
    "flet>=0.86.5",
    "flet-webview-all",
]

To install the latest unreleased version directly from GitHub instead, use:

[project]
dependencies = [
    "flet>=0.86.5",
    "flet-webview-all @ git+https://github.com/zaim-tech/flet-webview-all.git",
]

For a local checkout during development, add the package as a path dependency instead. See the included example application for a working configuration.

Usage

import flet as ft

from flet_webview_all import FletWebviewAll


def main(page: ft.Page):
    page.title = "WebView example"
    page.add(
        FletWebviewAll(
            url="https://flet.dev",
            expand=True,
        )
    )


ft.run(main)

Render HTML directly

Pass a complete HTML document using html. The control loads url when it is set; otherwise, it uses html.

page.add(
    FletWebviewAll(
        html="""
        <!doctype html>
        <html>
          <body><h1>Hello from Flet</h1></body>
        </html>
        """,
        expand=True,
    )
)

Control properties

Property Type Default Description
url str | None None URL to load. When set, it takes precedence over html.
html str | None None Complete HTML document to render when url is not set.
allow_navigation bool True Allows navigation requests from the WebView.
zoom_enabled bool True Enables WebView zoom where the platform supports it.
javascript_enabled bool True Enables unrestricted JavaScript execution.
user_agent str | None None Overrides the WebView user-agent when provided.
debugging_enabled bool False Prints JavaScript console messages through Flutter's debug logger.
remote_debugging_port int | None None Windows-only, startup-time WebView2 CDP port (1..65535) for attaching Playwright to the visible WebView.

Playwright on Windows

On Windows, set remote_debugging_port on the first WebView. WebView2 uses one shared browser environment per process, so later WebViews inherit the same CDP endpoint. Any later control that explicitly specifies a port must use the same value. Changing the property after startup requires restarting the application.

Remote debugging is intended for development and test automation. The CDP endpoint has no application-level authentication and can inspect every WebView in the shared environment, so leave remote_debugging_port=None in production.

webview = FletWebviewAll(
    url="https://example.com",
    remote_debugging_port=9222,
    expand=True,
)
page.add(webview)

Playwright can then attach to the exact WebView2 instance shown inside Flet:

from playwright.async_api import async_playwright

async def attach():
    playwright = await async_playwright().start()
    browser = await playwright.chromium.connect_over_cdp(
        "http://127.0.0.1:9222"
    )

    pages = [
        page
        for context in browser.contexts
        for page in context.pages
    ]
    for page in pages:
        print(page.url)

    page = next(
        page for page in pages
        if page.url.startswith("https://example.com")
    )
    print(await page.title())

Before connecting, http://127.0.0.1:9222/json/list should list the WebView2 page target.

If another WebView2 controller is created before the control that specifies remote_debugging_port, WebView2 may already have initialized its shared environment and the port can no longer be enabled without restarting the application.

Use page.update() after changing a control property at runtime:

webview.javascript_enabled = False
page.update()

Platform support

Support is supplied by the underlying webview_all package:

Platform Minimum requirement / implementation
Android API 24+
iOS 13.0+ (WKWebView)
Linux webkit2gtk-4.1
macOS 10.15+ (WKWebView)
Windows Windows 10 version 1809+ (WebView2)
Web Modern browser

Platform WebView engines can differ in their capabilities. Test the settings your application relies on on each target platform.

Build the example

Flet extensions include Python and Flutter code. After changing the Flutter package, rebuild the example application; Python-only changes can be run without rebuilding once the extension has been built for the target platform.

cd examples/flet_webview_all_example
flet build windows -v

Replace windows with another supported Flet build target, such as macos, apk, ipa, or web. To run the example during Python development:

flet run

Development

Contributions are welcome. See CONTRIBUTION.md for the contribution workflow, pull-request expectations, and issue-reporting guidance.

The project follows Flet's extension structure:

src/flet_webview_all/                  Python control
src/flutter/flet_webview_all/          Flutter extension and webview_all dependency
examples/flet_webview_all_example/     Sample Flet application
docs/                                  Additional documentation

To add or update the Flutter dependency, work from the Flutter package directory:

cd src/flutter/flet_webview_all
flutter pub get

⚠️ Important Note

When running your app without building the extension using flet build ..., you will see an error box instead of the actual webview widget. To see the real widget, you must build the extension for your target platform.

References

License

See LICENSE.

Metadata

Release files for flet-webview-all 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flet-webview-all 0.1.6
File Size Uploaded
flet_webview_all-0.1.6.tar.gz 18.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flet-webview-all 0.1.6
File Interpreter ABI Platform
flet_webview_all-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 39.5 kB

Release files / flet_webview_all-0.1.6.tar.gz

Download URL flet_webview_all-0.1.6.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e9fa044bd46af5f8ca635bf976d1153b7381affa2da49c62df2bae182d7ac94a
BLAKE2b-256 checksum
How to use checksums
f7334cba2613910875566d0a2fcd7f7b8a7ef11014acc5cc2096070a33c3dc57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / flet_webview_all-0.1.6-py3-none-any.whl

Download URL flet_webview_all-0.1.6-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5923d2443ea07a327d762fa6f8ab62b530621021514d5bf393030db1a37a839
BLAKE2b-256 checksum
How to use checksums
82e18d7827dce9a20fd04f793ddf33807784a02d6e9b639422d9bd9bc38cc252
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page