PlateSpec class

A complete plate design. Adding a plate means adding a const of this type, never a widget.

Annotations

Constructors

PlateSpec({required String id, required PlateCountry country, required double canvasWidth, required double canvasHeight, PlatePanel panel = PlatePanel.none, required List<PlateSlot> slots, bool? noPanel, PlateSection background = PlateSection.plain, List<PlateBand> bands = const <PlateBand>[], List<PlateRule> rules = const <PlateRule>[], List<PlateLabel> labels = const <PlateLabel>[], List<PlateDecal> decals = const <PlateDecal>[], List<PlateMirror> mirrors = const <PlateMirror>[], TextDirection textDirection = .ltr, double? borderWidthRatioOverride, Color? inkOverride, List<PlateTextGroup> textGroups = const <PlateTextGroup>[], List<PlateRestriction> restrictions = const <PlateRestriction>[], PlateThemeResolver? resolveTheme, PlateLabelResolver? resolveRegion})
const

Properties

background → PlateSection
The face's regions and the dividers between them, painted under the border. A panel running edge to edge belongs here as a PlateFill.panel region.
final
bands → List<PlateBand>
Blocks of colour floating on background, under rules and labels.
final
borderWidthRatioOverride → double?
final
canvasHeight → double
final
canvasWidth → double
final
country → PlateCountry
final
decals → List<PlateDecal>
final
effectiveTextGroups → List<PlateTextGroup>
textGroups, or one group per slot when none are named.
no setter
hashCode → int
The hash code for this object.
no setteroverride
id → String
Stable identifier, e.g. 'xx.car'. The sole basis of operator ==.
final
inkOverride → Color?
The one ink this plate is printed in, for a design whose print colour is its own rather than the host's livery. Replaces the whole monochrome set (glyphs, border, rules, completed-field outline). Null for the theme's.
final
labels → List<PlateLabel>
final
mirrors → List<PlateMirror>
Echoes of slot values; they never count towards slotCount.
final
noPanel → bool
Suppresses panel for a plate with no country block; by default, when panel is PlatePanel.none. A bool rather than a nullable panel because callers read spec.panel.box unconditionally.
final
panel → PlatePanel
final
resolveRegion → PlateLabelResolver?
Where the typed characters say the plate was issued, for a plate with no room to print it; the host shows it via PlateController.regionCaption. Null while it cannot be told. Static or top-level, to keep the spec const.
final
resolveTheme → PlateThemeResolver?
Derives the theme from the typed characters, or null for the host's. Static or top-level, to keep the spec const.
final
restrictions → List<PlateRestriction>
Register values this plate refuses outright. Each must name a keyed group in textGroups; debugValidateSpec asserts it.
final
rules → List<PlateRule>
Marks that do not divide the plate, like a short tick. An edge-to-edge line is a PlatePart.divider.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
slotCount → int
no setter
slots → List<PlateSlot>
final
textDirection → TextDirection
final
textGroups → List<PlateTextGroup>
Slot indices grouped for text rendering, in textDirection reading order: the groups passed in, else those the slots' PlateSlot.group keys form (consecutive slots sharing a key are one group, an unkeyed slot is its own). Empty when neither names a group: one group per slot, as effectiveTextGroups spells out.
no setter

Methods

checkRestrictions(List<String?> values) → void
Throws PlateRestrictionException when values break a restriction. For values that bypass a controller, such as a database row or a scan.
groupAt(int index) → PlateTextGroup?
groupNamed(String key) → PlateTextGroup?
indicesOfGroup(String key) → List<int>
Empty for an unknown key.
nextIndex(int index) → int?
The slot focus advances to from index, or null at the end.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
previousIndex(int index) → int?
The slot focus steps back to from index, or null at the start.
renderGroup(PlateTextGroup group, List<String?> values) → String
group's prefix followed by its slot values rendered through their alphabets. Unset slots render as ''.
restrictionViolatedBy(List<String?> values) → PlateRestriction?
The first of restrictions that values break, or null.
slotAt(int index) → PlateSlot?
The slot at index, or null when index is outside the plate.
toString() → String
A string representation of this object.
inherited
valueOfGroup(String key, List<String?> values) → String
The raw (unrendered) values of the group named key, concatenated; '' for an unknown key or unset slots.

Operators

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