LumenStyle class
Kit visual effect tokens: shadow, fill, surface, border and background.
Independent of colors (LumenPalette) — any style works with any palette. Use a preset (neon, flat, glass, soft, brutal) or adjust via copyWith:
AppTheme.fromPreset(LumenPreset.matrix, style: LumenStyle.flat);
- Annotations
Constructors
- LumenStyle({LumenShadowKind shadow = LumenShadowKind.glow, double shadowStrength = 1, bool gradients = true, double surfaceOpacity = 1, double blurSigma = 0, double radiusScale = 1, double borderScale = 1, double borderOpacity = 1, LumenBackgroundKind background = LumenBackgroundKind.grid, bool orbs = true})
-
Creates a custom style.
const
Properties
- background → LumenBackgroundKind
-
Background decoration.
final
- blurSigma → double
-
Blur applied behind surfaces (glass effect).
final
- borderOpacity → double
-
Edge opacity multiplier.
final
- borderScale → double
-
Edge thickness multiplier.
final
- gradients → bool
-
If
false, gradients become solid color (the first color of the gradient).final - hashCode → int
-
The hash code for this object.
no setterinherited
- orbs → bool
-
Whether to draw the glow orbs in the bottom corners.
final
- radiusScale → double
-
Corner radius multiplier.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shadow → LumenShadowKind
-
Shadow type applied to all widgets.
final
- shadowStrength → double
-
Shadow opacity multiplier.
final
- surfaceOpacity → double
-
Surface opacity multiplier (cards, dialogs, sheets…).
final
Methods
-
borderAll(
{Color color = const Color(0xFF000000), double width = 1}) → Border - Uniform border with style-adjusted thickness and opacity.
-
copyWith(
{LumenShadowKind? shadow, double? shadowStrength, bool? gradients, double? surfaceOpacity, double? blurSigma, double? radiusScale, double? borderScale, double? borderOpacity, LumenBackgroundKind? background, bool? orbs}) → LumenStyle - Returns a new style preserving unspecified tokens.
-
fill(
Gradient? gradient) → Gradient? - Fill gradient; turns solid color when gradients is false.
-
frost(
{required Widget child, BorderRadius? borderRadius}) → Widget - Wraps a surface with background blur when blurSigma > 0.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
radius(
double r) → BorderRadius - Corner radius scaled by radiusScale.
-
shadows(
List< BoxShadow> ? glows) → List<BoxShadow> ? - Adapts shadows written in a neon (glow) look to the current style. Small glows (blur < 10, e.g. status points) are decorative and only exist in style LumenShadowKind.glow.
-
surfaceAlpha(
double alpha) → double - Opacity of a surface adjusted by surfaceOpacity.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
of(
BuildContext context) → LumenStyle -
Style registered with the nearest
Theme.
Constants
- brutal → const LumenStyle
- Straight corners, thick border and offset hard shadow.
- flat → const LumenStyle
- No glow or gradient, neutral shade, smooth background.
- glass → const LumenStyle
- Frosted glass: translucent surfaces with blur and soft glow.
- neon → const LumenStyle
- Original look: colorful glow, gradients, grid and orbs.
-
presets
→ const Map<
String, LumenStyle> - All presets, in displayed order.
- soft → const LumenStyle
- Well-rounded corners, diffuse shadows and no edges.