SystemColor class final

A color specified in the operating system UI color palette.

The static getters in this class, such as accentColor and buttonText, provide standard system colors defined by the W3C CSS specification.

As of the current release, system colors are supported on web only. To check if the current platform supports system colors, use the static platformProvidesSystemColors field. If the field is false, other functions in this class will throw UnsupportedError.

This class is typically used in conjunction with AccessibilityFeatures.highContrast. In particular, on Windows, when a user enables high-contrast mode, they may also pick specific colors that should be used by application user interfaces. While it is common for applications to use custom color themes and design languages, in high-contrast mode it is recommended that widgets use system-specified colors to make content more legible for users.

See also:

Constructors

SystemColor.new({required String name, Color? value})
Creates an instance of a system color.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
isSupported bool
Returns true if the current platform provides the system color with the given name.
no setter
name String
Standard system color name, as defined by W3C CSS specification.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value Color?
The color value used for the color named name, if supported.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

accentColor SystemColor
Returns system color named "AccentColor".
no setter
accentColorText SystemColor
Returns system color named "AccentColorText".
no setter
activeText SystemColor
Returns system color named "ActiveText".
no setter
buttonBorder SystemColor
Returns system color named "ButtonBorder".
no setter
buttonFace SystemColor
Returns system color named "ButtonFace".
no setter
buttonText SystemColor
Returns system color named "ButtonText".
no setter
canvas SystemColor
Returns system color named "Canvas".
no setter
canvasText SystemColor
Returns system color named "CanvasText".
no setter
field SystemColor
Returns system color named "Field".
no setter
fieldText SystemColor
Returns system color named "FieldText".
no setter
grayText SystemColor
Returns system color named "GrayText".
no setter
highlight SystemColor
Returns system color named "Highlight".
no setter
highlightText SystemColor
Returns system color named "HighlightText".
no setter
linkText SystemColor
Returns system color named "LinkText".
no setter
mark SystemColor
Returns system color named "Mark".
no setter
markText SystemColor
Returns system color named "MarkText".
no setter
platformProvidesSystemColors bool
Returns true if the current platform provides system colors.
no setter
selectedItem SystemColor
Returns system color named "SelectedItem".
no setter
selectedItemText SystemColor
Returns system color named "SelectedItemText".
no setter
visitedText SystemColor
Returns system color named "VisitedText".
no setter