forceDark property
- @Deprecated('Use algorithmicDarkeningAllowed instead')
getter/setter pair
Use algorithmicDarkeningAllowed instead.
Set the force dark mode for this WebView. The default value is ForceDark.OFF.
Deprecated - The "force dark" model previously implemented by WebView was complex and didn't
interoperate well with current Web standards for prefers-color-scheme and color-scheme.
In apps with targetSdkVersion ≥ android.os.Build.VERSION_CODES.TIRAMISU this API is a no-op and
WebView will always use the dark style defined by web content authors if the app's theme is dark.
To customize the behavior, refer to algorithmicDarkeningAllowed.
Officially Supported Platforms/Implementations:
- Android WebView 29+ (Official API - WebSettings.setForceDark)
Implementation
@Deprecated('Use algorithmicDarkeningAllowed instead')
ForceDark? forceDark;