NamedColorStyle class final

A named color style: a paint (a solid color or a gradient), and optionally the dark paint it has in dark mode.

{"id": "c1", "name": "Surface", "paint": {"color": "#FFFFFFFF"}, "dark": {"color": "#FF121212"}}

A node the style is applied to keeps the light values; one whose color binds to the theme (${theme.surface}, ${theme.colors.brandBlue}) follows the device's mode at run time (StyleSheet.theme).

Constructors

NamedColorStyle({required String id, required String name, required Paint paint, Paint? dark})
const

Properties

color → Color?
The paint's color with its opacity, for a solid paint.
no setter
dark → Paint?
The paint in dark mode; null: paint in both modes.
final
darkColor → Color?
The dark paint's color with its opacity, for a solid dark paint.
no setter
hashCode → int
The hash code for this object.
no setteroverride
id → String
final
name → String
final
paint → Paint
final
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
toJson() → Json
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(Object? json) → NamedColorStyle?