palestine_plate 0.3.0
palestine_plate: ^0.3.0 copied to clipboard
Palestine's licence plates for the plate_core library — the West Bank and Gaza specs, the alphabets, the usage themes and the advisory validators.
0.3.0 #
-
Breaking: removed the
@DeprecatedPSWestBankPlates.legacyCarForUsageshim. 0.2.0 kept it for one release; this is that release. It returnedlegacyCarfor every usage. PasslegacyCountryForUsage(usage)toPlateCanvas.countryalongsidelegacyCarinstead. -
Breaking:
PSSerialGeneratoris spec-driven.modernWestBank,legacyWestBankandgazanow take aPlateSpecand an optionalrandom:, matchingyemen_plate's generator shape. Each register's characters are written at the slot indices the spec's ownregion/serial/governorate/district/prefix/usagetext groups name, viaPlateSpec.indicesOfGroup, instead of into a fixed positional list. A spec whose serial sits elsewhere (e.g. a bottom-row-first two-line layout) now generates correctly; before it silently produced a wrong plate. Handed a spec with no matching groups, the generator throwsArgumentError. Seeded output is byte-identical to 0.2.0 for every existing spec: the draw order (and the legal value sets) are unchanged.
0.2.0 #
- Breaking: the legacy West Bank ink is a render-time value, not three specs.
Removed
PSWestBankPlates.legacyCarPublicTransportandPSWestBankPlates.legacyCarGovernment— geometry clones oflegacyCarthat differed only in theف / Pblock ink. Removed thelegacyCarForUsagelookup (kept for one release as a@Deprecatedshim that returnslegacyCarregardless of usage). UselegacyCarwithPSWestBankPlates.legacyCountryForUsage(usage)handed toPlateCanvas.country, besidePSThemes.forUsage(usage).PSWestBankPlates.alland the gallery now hold 11 specs, not 13. The three ink consts (PSCountries.westBankGreenInk/.westBankWhiteInk/.westBankRedInk) stay — they are exactly what a host now passes tocountry:. Goldens unchanged. - Fixed:
PSWestBankPlates.modernMoto's serial was unevenly pitched. Its four digits were hand-written at x 60.5, 92, 124, 156 — pitches of 31.5, 32, 32 — and are now a uniform 32 from x 60: 60, 92, 124, 156. The first cell moves half a unit on a 250-wide canvas, and the header band's·centres it documents are correspondingly 27.5, 75, 107, 139, 171, 220. The goldenwb_modern_moto_green.pngwas regenerated for this and is the only golden that changed; every other one is byte-identical. Nothing but pitch was touched. - The serial runs are registers, not rectangles.
_modernCarSlots,_legacyCarSlots,modernMotoand Gaza's_sevenCellSlots,_motoSlotsand_twoLineSlotsbuild their four-cell serials withplateRegister(core 0.6.0) rather than fourPlateBoxliterals apiece. The isolated region, district and governorate cells and the trailing usage pairs stay literal — they sit in the gaps the·labels occupy and are not part of any register. No coordinate changed except the drift above. - Every
PlateSpecin this package is nowstatic finalrather thanstatic const, as are thealllists: aconstconstructor cannot run a loop.PlateSpecequality is overidalone and astatic finalis initialised lazily once per isolate, so this changes no behaviour — but a const-context use (const spec = …) must becomefinal spec = …, as the examples and validator tests now do. - Requires
plate_core: ^0.6.0forplateRegister. - Gaza car plates: vertical flag only. Removed
PSGazaPlates.car2021, the one-line design with the flag the right way up and a watermark — a Gaza car plate now only ever renders ascar2012, with the flag turned a quarter turn. The two-line wraps (car2012TwoLine,car2021TwoLine) are unaffected: a landscape band cannot hold a vertical strip, so both already carried the horizontal flag and still do. - New:
PSGazaPlates.moto. A one-line Gaza motorcycle plate, carrying the horizontal flag and watermark thatcar2021used to. PSWestBankPlates.modernMotorebuilt from a reference image. It wasmodernCarrescaled onto a 200 x 100 canvas, guessed throughout. It is now measured offpics/License_Plate_-_Palestine_-_Motorcycle_-_2018_-_1-Line_Design.png, on that image's own 250 x 123 canvas, and the layout is materially different: the serial runs the full width of the plate, andPandفsit side by side in a centred header band above it —Pon the left — separated by a short vertical divider, where the old spec stackedفoverPin a strip on the right. This is a visual breaking change for anyone rendering it.- New:
PSCountries.westBankGreenInkBlank. A West Bank country that draws no caption and no flag, somodernMotocan printP,فand the divider as measured plate-space geometry instead of going throughCountryPanel's vertical-only caption column.
0.1.0 #
First release.
-
Contains Palestine's plate data as
consts forplate_core: ^0.1.0, and depends on nothing else. No widget, no painter, no bloc:PlateCanvasandShowPlaterender every spec here. -
Two designs, not one.
PSWestBankPlates(nine specs: modern and legacy car, the public-transport and government colour variants, both two-line wraps, two motorcycle form factors and the trade plate) andPSGazaPlates(four: the 2012 and 2021 treatments, each with a two-line wrap). Gaza left the Palestinian Authority's numbering in 2012, carries a flag where the West Bank carriesف / P, and never inverts its white field. -
Colour is derived from usage, never chosen.
PSThemes.forUsageandPSThemes.forGazaUsageCodedo the lookup overPSUsage,PSLegacyUsageandPSGazaUsage.PlateSpeccarries no theme field, so the host passestheme:or wraps the canvas in aPlateThemeScope.forGazaUsageCodereturns null for an unallocated code rather than a fallback theme. -
One
PlateCountryper ink colour, all withcode: 'ps'so they compare equal.PlateCountrycarries colours andPlateSpeccarries a country, so a country const is pinned to one scheme; leavingpanelColortransparent collapses six schemes into three consts plus the inline variant the two-line motorcycle plate needs. -
Three advisory validators —
PSWestBankModernValidator,PSWestBankLegacyValidator,PSGazaValidator— one per scheme rather than one that sniffs which scheme it is looking at. Each isconst, never throws, never bars a keystroke, stays quiet until the user reaches the group being judged, and exposes a static spec-freevalidateFields. Named failures arestatic const Stringreason constants: theI/Ogap, theP–Tletters allocated to Gaza and never issued, the illegal legacy districts0and2, the unallocated Gaza usage classes, and a Gaza prefix other than3. -
PSSerialGeneratorproduces reproducible synthetic serials from a seededRandom, drawing only from the legal sets its matching validator accepts. -
Owns
assets/flags/Flag_of_Palestine.svg, a pre-rotated vertical twin for the 2012 Gaza plate, andassets/marks/palestine_watermark.png. Each is declared in this package'spubspec.yamlin the same commit as the literal that names it, so there is no revision in which an asset reference points at a bundle that does not declare the file. -
Nearly all geometry and colour is provisional. Only
PSColors.green(0xFF3C875D),borderWidthRatio: 0.027andplateRadiusRatio: 0.10come from a photograph —palestine_plate/pics/reference_plate.png. Everything else is marked// CALIBRATEon the line. Goldens cover every spec × theme so a retune is a visible diff. -
Supersedes
palestine_plate, which covered one green-on-white car spec and theف / Pblock. Its measured geometry, sampled green and validator reasoning carry over.palestine_plateis untouched on disk.
Known plate_core limitations #
None of these were worked around by editing plate_core:
PlateDecaltakes anImageProvider, not aPlateAsset, and paints at full opacity — so the Gaza watermark ships as a pre-faded PNG rather than an SVG.- No rotation hook, so the 2012 Gaza flag ships pre-rotated as a second asset.
CountryPanellayscaptionLinesout as aColumnonly, so the two-line motorcycle plate putsفandPin one string to set them side by side.