Android
Android is provided by webview_all_android ^1.3.6. webview_all registers it as the default Android implementation.
Engine
Section titled “Engine”| Item | Value |
|---|---|
| Package | webview_all_android |
| Main platform class | AndroidWebViewPlatform |
| Controller | AndroidWebViewController |
| Widget | AndroidWebViewWidget |
| Navigation delegate | AndroidNavigationDelegate |
| Cookie manager | AndroidWebViewCookieManager |
| Engine | Android WebView |
Minimum supported by webview_all |
API 24+ |
Creation Params
Section titled “Creation Params”final params = AndroidWebViewControllerCreationParams();final controller = WebViewController.fromPlatformCreationParams(params);AndroidWebViewControllerCreationParams mainly exposes test injection for Android WebStorage. Runtime settings are configured on the platform controller after construction.
Controller API
Section titled “Controller API”| API | Purpose |
|---|---|
AndroidWebViewController.enableDebugging(bool enabled) |
Enables Android WebView debugging globally. |
setAllowFileAccess(bool allow) |
Allows or blocks file URL access. |
setMediaPlaybackRequiresUserGesture(bool require) |
Controls automatic media playback. |
setTextZoom(int textZoom) |
Sets text zoom percentage. |
setUseWideViewPort(bool use) |
Enables viewport meta tag and wide viewport behavior. |
setAllowContentAccess(bool enabled) |
Allows or blocks content:// URL access. |
setGeolocationEnabled(bool enabled) |
Enables WebView geolocation support. |
setOnShowFileSelector(callback) |
Handles <input type="file">. |
setGeolocationPermissionsPromptCallbacks(...) |
Handles Geolocation API permission prompts. |
setCustomWidgetCallbacks(...) |
Handles fullscreen custom views, commonly video. |
setMixedContentMode(MixedContentMode mode) |
Controls HTTPS pages loading HTTP content. |
isWebViewFeatureSupported(WebViewFeatureType featureType) |
Queries AndroidX WebView feature support. |
setPaymentRequestEnabled(bool enabled) |
Enables Payment Request API when supported. |
setInsetsForWebContentToIgnore(List<AndroidWebViewInsets> insets) |
Prevents selected window insets from reaching web content. |
File Loading with Headers
Section titled “File Loading with Headers”await (controller.platform as AndroidWebViewController).loadFileWithParams( AndroidLoadFileParams( absoluteFilePath: '/sdcard/Download/help.html', headers: const <String, String>{'X-App': 'example'}, ),);Mixed Content
Section titled “Mixed Content”await (controller.platform as AndroidWebViewController) .setMixedContentMode(MixedContentMode.neverAllow);Values:
| Value | Behavior |
|---|---|
MixedContentMode.alwaysAllow |
Allows secure pages to load insecure content. |
MixedContentMode.compatibilityMode |
Uses Android WebView compatibility behavior. |
MixedContentMode.neverAllow |
Blocks insecure content from secure pages. |
Payment Request
Section titled “Payment Request”final android = controller.platform as AndroidWebViewController;
if (await android.isWebViewFeatureSupported( WebViewFeatureType.paymentRequest,)) { await android.setPaymentRequestEnabled(true);}Payment apps may require Android manifest queries entries so WebView can discover installed payment handlers.
Permission Resources
Section titled “Permission Resources”Android supports the common camera and microphone resource types, plus:
| Type | Meaning |
|---|---|
AndroidWebViewPermissionResourceType.midiSysex |
MIDI sysex. |
AndroidWebViewPermissionResourceType.protectedMediaId |
Protected media identifier. |
File Selector
Section titled “File Selector”await (controller.platform as AndroidWebViewController) .setOnShowFileSelector((FileSelectorParams params) async { return pickFiles( allowMultiple: params.mode == FileSelectorMode.openMultiple, acceptedTypes: params.acceptTypes, );});FileSelectorMode values are open, openMultiple, and save.
Cookies and Native Access
Section titled “Cookies and Native Access”getCookies splits Android’s cookie header at semicolons and each entry at its
first equals sign, so encoded values and values containing = are preserved.
Malformed percent escapes are returned literally instead of failing the whole
query. Returned entries use the requested host and /.
Native Android clients can retrieve a plugin-owned WebView from either a
FlutterPluginBinding or the deprecated FlutterEngine overload of
WebViewFlutterAndroidExternalApi. The binding overload remains compatible
with Flutter 3.35 by using its engine plugin registry.
Known Limits
Section titled “Known Limits”loadRequestcannot send custom headers with a POST body because Android WebView’spostUrlAPI does not expose headers.- WebView permission approval does not replace Android runtime permissions. Your app must request system permissions separately.
- Payment Request depends on AndroidX WebKit feature support and the installed WebView version.
- The Android plugin selects its Kotlin integration from the host project’s Android Gradle Plugin: AGP 8 and earlier use the Kotlin Gradle Plugin, while AGP 9 and later use Built-in Kotlin. This keeps older Flutter projects compatible without conflicting with newer Android builds.