MaterialShade enum

An enumeration of the available MaterialColor shade intensities.

Material Design swatches (MaterialColor) expose ten fixed shade intensities keyed by the integers 50, 100, 200, 300, 400, 500, 600, 700, 800, 900. Modeling them as an enum (rather than passing raw ints around) gives compile-time exhaustiveness: a switch over MaterialShade is checked by the analyzer, so adding or removing a rung forces every consumer to be updated instead of silently mishandling an unknown integer.

The declaration order is the intensity order (lightest first), so the enum index is a stable, persistable ordinal — see MaterialShadeName.value for the mapping to the Material integer.

Example:

final Color swatch = Colors.blue[MaterialShade.shade500.value]!; // blue[500]
Inheritance
Available extensions

Values

shade50 → const MaterialShade

The lightest shade (Material integer 50).

shade100 → const MaterialShade

Material integer 100.

shade200 → const MaterialShade

Material integer 200.

shade300 → const MaterialShade

Material integer 300.

shade400 → const MaterialShade

Material integer 400 — the last rung of the light band.

shade500 → const MaterialShade

Material integer 500 — the swatch's primary tone, first of the dark band.

shade600 → const MaterialShade

Material integer 600.

shade700 → const MaterialShade

Material integer 700.

shade800 → const MaterialShade

Material integer 800.

shade900 → const MaterialShade

The darkest shade (Material integer 900).

Properties

displayName String

Available on MaterialShade, provided by the MaterialShadeName extension

The plain UI label for this shade, e.g. 'Shade 500'.
no setter
displayNameAnnotated String

Available on MaterialShade, provided by the MaterialShadeName extension

The UI label annotated at the three band endpoints.
no setter
hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
onShade Color

Available on MaterialShade, provided by the MaterialShadeName extension

The readable foreground color to draw on top of this shade.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value int

Available on MaterialShade, provided by the MaterialShadeName extension

The raw Material integer used to index a MaterialColor.
no setter

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

Constants

values → const List<MaterialShade>
A constant List of the values in this enum, in order of their declaration.