PaperKeyFace class final

Paper & ink key renderer for one theme. A same-family theme change lerps every colour and number (LerpableKeyFace); the artwork is the key's own and does not change.

Inheritance
Implemented types

Constructors

PaperKeyFace({required Color ink, required Color wash, required Color slip, double outlineWidth = 1.5, double hatchAlpha = 0.65, double depth = 1, double cornerFraction = 0.04, double grain = 0, bool lite = false, bool slashedZero = false, PaperKeyFace? layoutBase})
const

Properties

cornerFraction → double
Face corner radius as a fraction of the key's short side (0–0.5).
final
depth → double
The face's press drop, dp.
final
grain → double
Paper grain opacity on the slips (0–1; half the sheet's).
final
hashCode → int
The hash code for this object.
no setteroverride
hatchAlpha → double
Operator hatch opacity (0–1).
final
ink → Color
The ink (palette shadow): outlines and hatch when a key style has no outline.
final
layoutBase → PaperKeyFace?
For an in-between face of a theme morph: the end it is closer to; null for a theme's own face.
final
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 setteroverride
lite → bool
Lite effects tier: no retrace, no stamp speckles.
final
outlineWidth → double
Fineliner width of pass 1, dp (the retrace is 0.55 ×).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
slashedZero → bool
Draw 0 with a slash (fonts that support zero).
finalinherited
slip → Color
The digit slip colour: the paper ring around the = stamp.
final
wash → Color
The ink wash's tide-line colour at its peak alpha (palette highlight); the blot fills at that alpha ÷ 1.6.
final

Methods

label(String text, TextStyle style) → Widget
Newsreader draws + − × ÷ = small (at its x-height): they are set 35 % larger than the other labels so the operators hold their own beside the digits; its hairline brackets and ± 12 % larger (paperLabelScale).
override
labelLayer(KeyFaceMotion motion, KeyFaceSpec spec, Widget label) → Widget
The label drops with the face (the scale channel when the motion has it), and gets the slip's label zone as its room (paperLabelZone, less 1 dp each side): a label wider than the zone (GRAD on a 56 dp key) scales down (KeyLabel) instead of running into the artwork. The zone is centred on the key, so a label that fits is laid out and placed exactly as before.
override
lerpTo(KeyFaceRenderer other, double t) → KeyFaceRenderer
This face t of the way to other (t may exceed 1 slightly: the shape rubber-band to 1.06). other's layoutFace has this face's renderer type.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
painter(KeyFaceMotion motion, KeyFaceSpec spec) → CustomPainter
The painter behind the label: fill, state layers, long-press fill. It should repaint from motion's listenable without rebuilds.
override
penFor(double s) → double
The usable pass-1 width on a key whose short side is s (≤ s / 24).
prepare(Iterable<Size> cellSizes) → void
Warms the shared paper grain tile (art seeds are not known here).
override
prepareLerp(KeyFaceRenderer other, Iterable<Size> cellSizes) → void
Nothing to build ahead: the artwork is theme-independent and cached per key.
override
toString() → String
A string representation of this object.
inherited

Operators

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