CalcThemeData class final

Everything the calculator widgets read for their look: resolved colours, key shape, type and the press-motion subset. M3 produces it from a ThemeSpec; M2 has PlainTheme.

Immutable and lerpable (CalcThemeData.lerp) for theme transitions. Read it with CalcTheme.of.

Annotations

Constructors

CalcThemeData({required Brightness brightness, required Color background, required Color displayText, required Color previewText, required Color errorText, required Color caret, required Color focusRing, required KeyStyle digitKey, required KeyStyle operatorKey, required KeyStyle equalsKey, required KeyStyle functionKey, double keyCornerFraction = 0.3, String? displayFontFamily, int? displayWeight, String? keyFontFamily, SpringDescription? pressIn, SpringDescription? release, SpringDescription? releaseAlt, double pressScale = 0.95, double pressedOverlayOpacity = 0.12, double hoverOverlayOpacity = 0.08, KeyFaceRenderer keyFace = const PlainKeyFace(), double focusRingWidth = 2, CalcBackdrop? backdrop, DisplayEntry? displayEntry, bool releaseHaptic = false, DisplayFace? displayFace, Color? accessiblePreviewText, ChromeStyle? chrome})
CalcThemeData.lerp(CalcThemeData a, CalcThemeData b, double t)
Interpolates every channel (t = 0 gives a, 1 gives b). Discrete values (brightness, fonts, springs) switch at t = 0.5.
factory

Properties

accessiblePreviewText → Color?
Under the Accessible theme lock (7:1 promise for display text), the colour of the live preview and the amount in words: previewText moved in OKLCH lightness until it is ≥ 7:1 on every display backdrop (the generator only holds previewText to 4.5:1 there). Null when the lock is off or the theme needs no change. Read secondaryText.
final
backdrop → CalcBackdrop?
Paints the calculator background (gradients, patterns); null means a plain background fill.
final
background → Color
Calculator surface behind the display and keypad.
final
brightness → Brightness
Light or dark (drives system UI overlay style).
final
caret → Color
Expression caret.
final
chrome → ChromeStyle?
The family's Material chrome recipe (settings, history, dialogs, sheets); null = stock Material 3 (the plain theme, the Accessible lock). Applied by materialThemeFor (package calsee_themes_material).
final
chromeEmphasis → Color
The emphasised counterpart of chromeForeground (the lock badge's flash): displayText, or black / white on the background.
no setter
chromeForeground → Color
Icons and secondary text drawn straight on the background (the toolbar): previewText, or — when a displayFace puts the display text on its own panel, so previewText is solved against the panel only — the focusRing colour, which is ≥ 3:1 on every background sample.
no setter
digitKey → KeyStyle
Digits, ., ±.
final
displayBackdrop → Color
The colour display text sits on: the displayFace panel, or the background.
no setter
displayEntry → DisplayEntry
How a new display glyph enters (motion brief §2.3 "Display entry").
final
displayFace → DisplayFace?
How the display draws its glyphs and panel (Retro: a 7-segment LCD); null = the display font on the background, no panel.
final
displayFontFamily → String?
Display font; null = platform default (with tabular figures).
final
displayText → Color
Expression and result text (≥ 3:1 on background; plain theme ≥ 4.5).
final
displayWeight → int?
The theme's display weight (CSS, TypeSpec.displayWeight), which a display without a displayFace sets on the font's wght axis; null = the display's own weights (the platform theme).
final
equalsKey → KeyStyle
=.
final
errorText → Color
Error message in the preview slot (≥ 4.5:1 on background).
final
focusRing → Color
Keyboard focus ring around keys.
final
focusRingWidth → double
Stroke width of focusRing (high-contrast themes draw it heavier).
final
functionKey → KeyStyle
Everything else: ⌫/AC, ( ), %, functions, memory, modes.
final
hashCode → int
The hash code for this object.
no setteroverride
hoverOverlayOpacity → double
Opacity of the key's state layer on a hovered key.
final
keyCornerFraction → double
Key corner radius as a fraction of the key's shorter side (0 = square, 0.5 = fully round). M3 adds real shapes.
final
keyFace → KeyFaceRenderer
Draws the key faces (M3 swaps in ThemeSpec-driven renderers).
final
keyFontFamily → String?
Key label font; null = platform default.
final
operatorKey → KeyStyle
+ − × ÷ and other binary operators.
final
pressedOverlayOpacity → double
Opacity of the key's state layer on a pressed key (the renderers' layer is contrast-safe: it moves the face away from its label).
final
pressIn → SpringDescription
Press-in spring (touch-down → pressed).
final
pressScale → double
Key scale when fully pressed.
final
previewText → Color
Live preview, indicators (M, DEG) and secondary text.
final
release → SpringDescription
Release spring (pressed → rest): scale, squish and depth.
final
releaseAlt → SpringDescription?
Release spring of the key's shape channel (corner morph), when it differs from release: M3 Expressive releases its corners on effectsDefault (no bounce, as Compose does) while the scale rides 800/0.6 (motion brief §2.3, §2.6 Motion.releaseAlt). Null: corners follow release. The state layer (an effects channel) never overshoots and always releases on an effects spring.
final
releaseHaptic → bool
Whether a key-up also fires HapticIntent.keyRelease (NeoPOP, Retro; motion brief §2.3).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
secondaryText → Color
The live preview and amount-line colour: accessiblePreviewText under the Accessible lock, else previewText.
no setter

Methods

keyFaceSpec(KeyRole role, {bool reduceMotion = false, int artSeed = 0}) → KeyFaceSpec
The face spec for a key with role.
keyStyle(KeyRole role) → KeyStyle
The style for keys with role.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sameLayout(CalcThemeData other) → bool
Whether other differs from this theme only in what painters read live during a transition (colours, opacities, corner fraction, press scale, focus-ring width, backdrop, the key face's shape): widgets built from CalcTheme.layoutOf need no rebuild.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

effectsDefault → SpringDescription
Motion brief effectsDefault (1600/1.0): release.
final
effectsFast → SpringDescription
Motion brief effectsFast (3800/1.0): soft press-in.
final

Constants

minPress → const Duration
Release starts no earlier than this after touch-down, so a quick tap still shows a press (motion brief §2.2). Input commits at pointer-up regardless.