ForceDarkStrategy class

Class used to indicate how WebView content should be darkened.

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toNativeValue() int
Gets int native value.
toString() String
A string representation of this object.
override
toValue() int
Gets int value.

Operators

operator ==(Object value) bool
The equality operator.
override

Static Properties

values Set<ForceDarkStrategy>
Set of all values of ForceDarkStrategy.
final

Static Methods

fromNativeValue(int? value) ForceDarkStrategy?
Gets a possible ForceDarkStrategy instance from a native value.
fromValue(int? value) ForceDarkStrategy?
Gets a possible ForceDarkStrategy instance from int value.

Constants

PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING → const ForceDarkStrategy
In this mode WebView content will be darkened by a user agent unless web page supports dark theme. WebView determines whether web pages supports dark theme by the presence of color-scheme metadata containing "dark" value. For example, <meta name="color-scheme" content="dark light">. If the metadata is not presented WebView content will be darkened by a user agent and prefers-color-scheme media query will evaluate to light.
USER_AGENT_DARKENING_ONLY → const ForceDarkStrategy
In this mode WebView content will be darkened by a user agent and it will ignore the web page's dark theme if it exists. To avoid mixing two different darkening strategies, the prefers-color-scheme media query will evaluate to light.
WEB_THEME_DARKENING_ONLY → const ForceDarkStrategy
In this mode WebView content will always be darkened using dark theme provided by web page. If web page does not provide dark theme support WebView content will be rendered with a default theme.