M3eKeyFace class
M3 Expressive key renderer for one theme.
Implements LerpableKeyFace: a same-family theme change morphs each key's resting outline into the next theme's through a cached FlatMorph (prepareLerp builds them ahead), following the transition's shape progress — including its rubber-band past 1.
- Inheritance
-
- Object
- KeyFaceRenderer
- ThemedKeyFace
- M3eKeyFace
- Implemented types
- Implementers
Constructors
- M3eKeyFace({required KeyGeometry restShape, KeyGeometry? operatorShape, int pressedCornerPermille = 300, bool rowSquish = false, bool slashedZero = false, KeyShapeCache? cache})
-
const
Properties
- cache → KeyShapeCache?
-
Shape cache (null = KeyShapeCache.instance).
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- layoutFace → KeyFaceRenderer
-
The renderer that decides the key's widgets (label, label layer):
itself, or for an in-between face of a theme morph the end it is
closer to. Compared by
CalcThemeData.sameLayout.no setterinherited - operatorShape → KeyGeometry?
-
Resting outline of operator and
=keys (a non-colour cue); null = restShape.final - pressedCornerPermille → int
-
Pressed corner radius (fraction of the short side × 1000; brief: 300).
final
- pressedShape → KeyGeometry
-
The pressed outline (same for every role).
no setter
- restShape → KeyGeometry
-
Resting outline of digit and function keys.
final
- rowSquish → bool
-
Row-neighbour squish (brief: 10 % of key width, "tune"). Reserved:
off by default and not drawn yet (it needs keypad-level layout).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- slashedZero → bool
-
Draw
0with a slash (fonts that supportzero).finalinherited
Methods
-
label(
String text, TextStyle style) → Widget -
The label widget for
textinstyle(already sized, coloured and weighted, Bold Text included). Not scaled by the text scaler: the key size bounds it.inherited -
labelLayer(
KeyFaceMotion motion, KeyFaceSpec spec, Widget label) → Widget -
Places
labelon the face for the press (NeoPOP moves it with the face). Must followmotionby repainting, never by rebuilding. The default leaves it centred.inherited -
lerpTo(
KeyFaceRenderer other, double t) → KeyFaceRenderer -
This face
tof the way toother(t may exceed 1 slightly: the shape rubber-band to 1.06).other'slayoutFacehas this face's renderer type.override -
morphFor(
KeyRole role, Size size) → KeyMorph -
The morph for
roleatsize(cache lookup; builds on a miss). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
outlineInto(
Path path, KeyRole role, Size size, double t) → void -
Resets
pathtorole's outline at press progresst(clamped, see M3eKeyPainter.morphProgress) in unit-square space. -
painter(
KeyFaceMotion motion, KeyFaceSpec spec) → CustomPainter -
The painter behind the label: fill, state layers, long-press fill. It
should repaint from
motion'slistenablewithout rebuilds.override -
prepare(
Iterable< Size> cellSizes) → void -
Builds every role's morph for keys of each of
cellSizesahead of time (keypad layout and theme prefetch), so no frame ever constructs aMorph.override -
prepareLerp(
KeyFaceRenderer other, Iterable< Size> cellSizes) → void -
Builds what lerpTo faces toward
otherwill paint (shape morphs) for keys ofcellSizes, ahead of the transition.override -
restFor(
KeyRole role) → KeyGeometry -
Resting outline for
role. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override