website/docs/controls/webview/index.md
import TabItem from '@theme/TabItem'; import Tabs from '@theme/Tabs'; import {ClassAll, CodeExample} from '@site/src/components/crocodocs';
Display web content in a WebView to be shown in your Flet apps.
It is powered by the webview_flutter and webview_flutter_web Flutter packages.
| Platform | Windows | macOS | Linux | iOS | Android | Web |
|---|---|---|---|---|---|---|
| Supported | ❌ | ✅ | ❌ | ✅ | ✅ | ✅ |
Add flet-webview to your project dependencies:
requirements.txt or pyproject.toml.
</TabItem>
<CodeExample path={frontMatter.examples + '/example_1/main.py'} language="python" />
If you run into the NET::ERR_CLEARTEXT_NOT_PERMITTED error in Android, then the app you’re using is trying to access a web page that wants to transmit cleartext or unsecured information. Android blocks apps from doing this in order to avoid compromising user data.
For more details, see this and this.
To fix it, your app's configuration (precisely, the manifest application attributes) needs to be modified as follows:
<Tabs groupId="pyproject-toml"> <TabItem value="pyproject-toml" label="pyproject.toml"> ```toml [tool.flet.android.manifest_application] usesCleartextTraffic = "true" ``` </TabItem> </Tabs> ## Description <ClassAll name={frontMatter.class_name} />