AstryxShadow class

One shadow layer, as CSS box-shadow describes it.

Flutter's BoxShadow cannot express an inset shadow, and five of Astryx's eight shadow tokens are inset — the focus, selection and validation rings on form controls. Dropping the distinction would silently render those as outer shadows, which is why this type exists rather than BoxShadow alone.

blurRadius is already in Flutter's units. See astryxCssBlurToFlutterRadius for why that is not the CSS number.

Annotations

Constructors

AstryxShadow({required Color color, Offset offset = Offset.zero, double blurRadius = 0, double spreadRadius = 0, bool inset = false})
Creates a shadow layer.
const

Properties

blurRadius double
The blur radius in Flutter's units, not CSS's.
final
color Color
The shadow colour, with the mode already selected.
final
hashCode int
The hash code for this object.
no setteroverride
inset bool
Whether the shadow is drawn inside the box rather than outside it.
final
offset Offset
The shadow's displacement.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
spreadRadius double
How far the shadow expands beyond the box before blurring.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toBoxShadow() BoxShadow
This shadow as a BoxShadow.
toBoxShadowOrNull() BoxShadow?
This shadow as a BoxShadow, or null when it is inset.
toString() String
A string representation of this object.
override

Operators

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

Static Methods

lerp(AstryxShadow? a, AstryxShadow? b, double t) AstryxShadow?
Linearly interpolates between two shadows.
lerpList(List<AstryxShadow>? a, List<AstryxShadow>? b, double t) List<AstryxShadow>?
Linearly interpolates between two shadow lists.