core_plate 0.1.0
core_plate: ^0.1.0 copied to clipboard
The backbone of license plate packages for countries that actually exist (we checked).
0.1.0 #
First pub.dev release. The four packages (core_plate, iran_plate,
germany_plate, plate_keypad) are now published with versioned
dependencies — the country and keypad packages depend on core_plate: ^0.1.0
rather than a sibling path:.
PlateCanvasnow wraps its face in aMaterial, so it renders outside aScaffoldwithout throwing.PlateCanvasdispatchesSpecIsChangedto thePlateCardBlocwhen itsspecchanges, keeping the bloc's value list the right length for the new spec.
P9 — the rename, and the split settles #
The package is now core_plate (was plate_number); its directory is
core-plate/ (was plate-core/); its barrel is
package:core_plate/core_plate.dart (was package:plate_number/plate_number.dart).
The lib/src/model/plate_number.dart file — the PlateNumber entered-value type — keeps
its name; it is a domain type, not the package.
Upgrading from plate_number 0.1.0 — every breaking change across P1–P9, in one place:
- The import.
package:plate_number/plate_number.dart→package:core_plate/core_plate.dart. Path dependencyplate_number: {path: ../plate-core}→core_plate: {path: ../core-plate}. These packages are path-only; they are not published to pub.dev (docs/split/PLAN.md§6.6). - The
plate_numberfacade is retired, not replaced. There is no meta-package that re-exports the four. A consumer imports exactly what it uses. The four imports that replace the old single import:import 'package:core_plate/core_plate.dart'; // always import 'package:iran_plate/iran_plate.dart'; // if you draw Iranian plates import 'package:germany_plate/germany_plate.dart';// if you draw German plates import 'package:plate_keypad/plate_keypad.dart'; // if you want the on-screen keypad - Validation no longer blocks input (P2).
PlateKeypad.unavailableKeys,GermanPlateValidator.barredNextDigits/barredNextLetters, theForbiddenByGroupmixin anddocs/forbidden.jsonare removed. A plate may now hold an invalid value. What survives:PlateValidator/PlateValidation/PlateEntry, a verdict and nothing more.PlateCanvasgainsvalidatorandautoValidate(defaultfalse); withautoValidate: truethe frame paints red inPlateTheme.alertColorand the keystroke still lands.PlateInputController.validationexposes the verdict on demand. - The core names no country (P3).
PlateCountry.iran/.germanyandPlateSpecs(irCar,irBicycle,deCar) are removed. See the country packages below. PlateFlagtakesrequired PlateCountry country(P3), notString countryCode, and renderscountry.flag(aPlateAsset?). Thecountry_flagsdependency and the_resolveSizeaspect-ratio guess are gone. NewPlateAsset/SvgPlateAsset/RasterPlateAsset;PlateCountrygainsPlateAsset? flag.CountryPanel.countryandPlateKeypad.digitAlphabet/letterAlphabetarerequired(P3) — they used to default to Iran / Persian.PlateAlphabetgainsTextDirection directionandString placeholder(P3). RTL and the empty-slot glyph are read off the alphabet, not sniffed againstpersianPlateLettersor hard-coded'؟'.PlateAlphabet.persianDigits/persianPlateLettersmoved (P3) toPersianAlphabetsiniran_plate.- Grouping moved into the model (P1).
PlateSpecgainseffectiveTextGroups/groupAt/renderGroup;ShowPlateno longer computes its own grouping. - Keypad grids collapsed (P4). One
_KeyGridfor both pads;_buildDigitKey/_buildLettersLayergone. Internal, but it is why the keypad shrank ~90 lines. - Public surface is now a decision (P5).
lib/src/holds the implementation;core_plate.dartexports a chosen list, not every file. Anything undersrc/the barrel does not name is not API. - Dead weight removed (P6).
PlateKeypadTheme.copyWith(unused), theargsdependency, and doc comments that described "a real Iranian licence plate" for country-neutral code. - The on-screen keypad left core (P7).
PlateKeypad,PlateKeypadTheme,kPlateBackspaceKey,kPlateKeypadSlideandPlateCharacterPickerare inplate_keypad.PlateCanvas.onChooseCharacteris nowrequired— core ships no fallback picker. Core no longer importspackage:flutter/cupertino.dart. - The countries left core (P8).
IranCountry/PersianAlphabets/IranPlatesare iniran_plate;GermanyCountry/GermanPlates/GermanPlateValidatorare ingermany_plate. Core ships no assets — noflutter.assets:block.flutter_svgstays:PlateFlagrenders whateverSvgPlateAsseta country hands it.docs/districts.jsonwas deleted (§6.8); the German district check stays shape-only (^[A-ZÄÖÜ]{1,3}$).
P8 — countries extracted to their own packages #
- Breaking: the countries have left core.
IranCountry,PersianAlphabetsandIranPlatesare removed fromplate_numberand now live in the sibling packageiran_plate(path: ../iran-plate);GermanyCountry,GermanPlatesandGermanPlateValidatorlive ingermany_plate(path: ../germany-plate). Switchimport 'package:plate_number/plate_number.dart';toimport 'package:iran_plate/iran_plate.dart';orimport 'package:germany_plate/germany_plate.dart';for those names; both packages depend onplate_number, so the imports coexist. Depend only on the countries you actually draw. - Breaking: core ships no assets. The
flutter.assets:block is gone. The two flag SVGs and the two German stickers moved into the packages that name them, and thepackage:argument of everySvgPlateAsset/AssetImageliteral moved with them in the same commit — an asset reference resolves against the bundle of the package that declares the file, so a literal and its declaration can never be in different packages, even briefly. flutter_svgremains a dependency:PlateFlagrenders whateverSvgPlateAsseta country hands it.docs/districts.jsondeleted — seedocs/split/PLAN.md§6.8. It was read by no code and declared in no pubspec, andgermany_platechose not to take on keeping a district list current.- This is the claim the whole split was built to make:
grep -rniE "iran|german|persian" plate-core/lib/returns nothing.
P7 — keypad extracted to its own package #
- Breaking: the on-screen keypad has left core.
PlateKeypad,PlateKeypadTheme,kPlateBackspaceKey,kPlateKeypadSlideandPlateCharacterPickerare removed fromplate_numberand now live in the sibling packageplate_keypad(path: ../plate-keypad). Switchimport 'package:plate_number/plate_number.dart';toimport 'package:plate_keypad/plate_keypad.dart';for those names; the keypad package depends onplate_numberforPlateAlphabet, so both imports coexist. - Breaking:
PlateCanvas.onChooseCharacteris nowrequired. It used to default to an internalPlateCharacterPicker; that picker moved out with the keypad, so core no longer has a fallback. PassPlateCharacterPicker.showfromplate_keypad, or anyFuture<String?> Function(PlateAlphabet)of your own. - Core no longer imports
package:flutter/cupertino.dartanywhere.
P3 — country decoupling #
-
Breaking: the core no longer names a country.
PlateCountry.iran/PlateCountry.germanyand thePlateSpecscatalogue (irCar,irBicycle,deCar) are removed, not deprecated — a shim would have re-introduced the country names the phase exists to remove. The constants moved tocountries/iran.dart(IranCountry.iran,PersianAlphabets.digits/.plateLetters,IranPlates.car/.bicycle) andcountries/germany.dart(GermanyCountry.germany,GermanPlates.car), both re-exported fromplate_number.dart.PlateAlphabet.persianDigits/persianPlateLetterslikewise moved toPersianAlphabets. -
GermanPlateValidatormoved tocountries/german_plate_validator.dart(still exported from the barrel) — it is a country artifact, and the phase's acceptance is that no file outsidecountries/names a country. -
New
PlateAsset(SvgPlateAsset/RasterPlateAsset): a country ships its own flag asset, named with the package that owns it.PlateCountrygainsPlateAsset? flag. -
Breaking:
PlateFlagtakesrequired PlateCountry countryinstead ofString countryCode, and renderscountry.flag(nothing when null). Its_resolveSizeaspect-ratio guess is gone. -
Dropped the
country_flagsdependency and its fallback rendering path; Germany now shipsassets/flags/Flag_of_Germany.svg. Every country renders from a vector. -
Breaking:
CountryPanel.countryandPlateKeypad.digitAlphabet/letterAlphabetare nowrequired— they defaulted to Iran / Persian. -
plate_number.dartnow also exportsmodel/plate_box.dart(PlateBoxis part of thePlateSpecsurface and consumers need it to build aPlatePanel). -
PlateAlphabetgainsTextDirection direction(defaultltr) andString placeholder(default'?').PlateKeypadreads direction off the alphabet instead of comparing against a constant;PlateSlotItemreads the empty-slot placeholder off the alphabet instead of hard-coding'؟'. -
Breaking: validation no longer prevents input.
PlateKeypad.unavailableKeysandGermanPlateValidator.barredNextDigits/barredNextLettersare removed, not deprecated. They existed to grey out and swallow the keys that would complete a forbidden value; a plate library has no business refusing a keystroke, and a plate may now hold an invalid value._keyEnabledstill disables a key outside the active alphabet — that is a fact about the alphabet, not a validation rule. -
New
PlateValidator/PlateValidation/PlateEntryinvalidators/plate_validator.dart: a validator answers one question — is this plate valid? — and returns a verdict. There is deliberately no "which keys are barred" method. -
PlateCanvasgainsvalidatorandautoValidate(defaultfalse). WithautoValidate: truethe canvas paints the invalid state itself, in the newPlateTheme.alertColor. With itfalsethe validator is never called by the canvas; readPlateInputController.validationand pick your own timing. -
PlateInputController.validationexposes the verdict on demand and notifies listeners when the verdict changes, not on every keystroke. -
GermanPlateValidatoris nowconst-constructible and implementsPlateValidator.GermanPlateValidationResultis atypedefforPlateValidation, kept for one release.validateValues(spec, values)is replaced by thevalidate(PlateEntry)override; the spec-free static is renamedvalidateFields. -
Removed
docs/forbidden.json. It duplicated_forbiddenLetterPairs/_forbiddenNumbersby hand and nothing read it; the Dart consts always were the source of truth. -
Rewrote
README.mdagainst the currentPlateSpec/PlateCanvasAPI.
0.0.1 — history as plate_number #
- Breaking: Removed
CarPlateNumberandBicyclePlateNumber. UsePlateCanvas(spec: PlateSpecs.irCar)andPlateCanvas(spec: PlateSpecs.irBicycle)instead. PlateCanvasis now exported from the package root (plate_number.dart) instead of requiring a deep import.- Breaking: Removed
PlateCanvas.showRemoveButtonandonRemove. Hosts should render their own remove control alongsidePlateCanvas.