BackgroundSpec class final
Background (spec §5.1 Background).
- Annotations
Constructors
-
BackgroundSpec({required BackgroundKind kind, required List<
int> colors, int angleTenths = 0, BackgroundPattern pattern = BackgroundPattern.none, int patternColor = 0, int patternScaleCdp = 0, int patternOpacityPermille = 0, int driftPeriodMs = 0}) -
colorsmust be unmodifiable (a const literal, or wrapped withList.unmodifiable): specs are deeply immutable and cache their stable hash. The generator,copyWithandfromJsonall comply.const - BackgroundSpec.fromJson(Object? json)
-
factory
Properties
- angleTenths → int
-
Linear gradient direction, tenths of a degree (0 = top → bottom).
Family scenes reuse it as a scene parameter (sphere layout, sun
azimuth or holo angle, paper grain strength, gradient tilt, horizon
height, poster orientation); same-family transitions lerp it along
the shorter arc.
final
- base → int
-
The base colour (first stop).
no setter
-
colors
→ List<
int> -
Solid: one colour. Gradients: stops in order (evenly spaced). Mesh:
control colours. Family scenes (
claySoft…bauhausComposition): the scene's colour roles by index, documented by the family.final - driftPeriodMs → int
-
Slow drift period for animated backgrounds (0 = static). Disabled by
Reduce Motion at runtime.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- kind → BackgroundKind
-
final
- pattern → BackgroundPattern
-
final
- patternColor → int
-
Pattern ink (usually translucent).
final
- patternOpacityPermille → int
-
Pattern opacity × 1000.
final
- patternScaleCdp → int
-
Pattern cell size, dp × 100.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{BackgroundKind? kind, List< int> ? colors, int? angleTenths, BackgroundPattern? pattern, int? patternColor, int? patternScaleCdp, int? patternOpacityPermille, int? driftPeriodMs}) → BackgroundSpec -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override