GlassThemeData class

The colours and tuning every Glisse widget reads, as Glisse's CSS custom properties (--lg-*) set them for a light and a dark page.

Annotations

Constructors

GlassThemeData.new({required Brightness brightness, required Color foreground, required Color muted, required Color glass, required Color glassActive, required Color edge, required Color drop, required Color selection, required Color lens, required Color lensDrop, required Color segmentTrack, required Color segmentThumb, required Color segmentLabel, required Color segmentLens, required Color surface, required Color surfaceEdge, required Color shadow, required Color highlight, required Color separator, required Color destructive, required Color track, required Color rail, required Color on, required Color fill, required Color ring, required double lensShine, required double rimShine, double blur = 3, double saturation = 1.5, double glassBend = 2, double glassDispersion = 0.6, double? switchBend, double? sliderBend, double? segmentBend, double? tabBend, double? tabDispersion, TextStyle textStyle = const TextStyle(fontSize: 14, height: 1.2, letterSpacing: -0.1), GlassMode mode = GlassMode.auto, GlassQuality quality = GlassQuality.auto})
Creates a theme from every colour and tuning value.
const
GlassThemeData.dark()
Glisse on a dark page.
factory
GlassThemeData.fallback(Brightness brightness)
Glisse for brightness.
factory
GlassThemeData.light()
Glisse on a light page.
factory

Properties

blur → double
The frost's blur, a deviation in logical px.
final
blursBackdrops → bool
Whether overlays such as menus may blur the page behind them with a backdrop filter. Not on the web below GlassQuality.high, where the browser blurs the page again for each one: they lean on their near-opaque surface there instead.
no setter
brightness → Brightness
Whether this theme is for a light or a dark page.
final
destructive → Color
Actions that delete or can't be undone.
final
drop → Color
Glass's small drop shadow.
final
edge → Color
The 0.5px line round glass's edge.
final
effectiveQuality → GlassQuality
quality, with GlassQuality.auto settled for this platform.
no setter
fill → Color
The accent: filled buttons, slider fill, selected tab icons.
final
foreground → Color
Text and icons on glass.
final
glass → Color
The frost laid over what glass shows.
final
glassActive → Color
The frost of pressed, hovered or focused glass.
final
glassBend → double
How far glass's rim reaches in, as a share of its bezel's width.
final
glassDispersion → double
How far glass's colours split: at 1, red bends a fifth further than blue.
final
hashCode → int
The hash code for this object.
no setteroverride
highlight → Color
A highlighted menu row.
final
isDark → bool
Whether brightness is dark.
no setter
lens → Color
A lifted lens's fill.
final
lensDrop → Color
A lifted lens's shadow.
final
lensShine → double
How a lens's rim catches the light: above 0 it brightens, below 0 it darkens, as on a light page.
final
mode → GlassMode
How glass reads what's behind it, for glass that doesn't say.
final
muted → Color
Secondary text: placeholders, unselected tabs, input icons.
final
on → Color
A switch's track when on.
final
quality → GlassQuality
How much work glass does to look its best; see GlassQuality.
final
rail → Color
A slider's rail.
final
rimShine → double
How bright glass's painted rim is.
final
ring → Color
The focus ring.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
saturation → double
How much glass saturates what it shows.
final
segmentBend → double?
Overrides glassBend for a segmented control's lens, as --lg-segment-bend does.
final
segmentLabel → Color
A segmented control's labels.
final
segmentLens → Color
A segmented control's lifted lens fill.
final
segmentThumb → Color
A segmented control's thumb.
final
segmentTrack → Color
A segmented control's track tint.
final
selection → Color
A tab bar's selection at rest.
final
separator → Color
Lines between rows.
final
shadow → Color
A surface's shadow.
final
sliderBend → double?
Overrides glassBend for a slider's lens, as --lg-slider-bend does.
final
surface → Color
Menus, sheets and dialogs.
final
surfaceEdge → Color
The line round a surface.
final
switchBend → double?
Overrides glassBend for a switch's lens, as --lg-switch-bend does.
final
tabBend → double?
Overrides glassBend for a tab bar's lens, as --lg-tab-bend does.
final
tabDispersion → double?
Overrides glassDispersion for a tab bar's lens.
final
textStyle → TextStyle
The base text style of labels on glass.
final
track → Color
A switch's track when off.
final

Methods

copyWith({Brightness? brightness, Color? foreground, Color? muted, Color? glass, Color? glassActive, Color? edge, Color? drop, Color? selection, Color? lens, Color? lensDrop, Color? segmentTrack, Color? segmentThumb, Color? segmentLabel, Color? segmentLens, Color? surface, Color? surfaceEdge, Color? shadow, Color? highlight, Color? separator, Color? destructive, Color? track, Color? rail, Color? on, Color? fill, Color? ring, double? lensShine, double? rimShine, double? blur, double? saturation, double? glassBend, double? glassDispersion, double? switchBend, double? sliderBend, double? segmentBend, double? tabBend, double? tabDispersion, TextStyle? textStyle, GlassMode? mode, GlassQuality? quality}) → GlassThemeData
A copy with the given fields replaced.
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.
override