Skip to main content

palestine_plate 0.3.0 copy "palestine_plate: ^0.3.0" to clipboard
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.

example/lib/main.dart

import 'package:plate_core/plate_core.dart';
import 'package:flutter/material.dart';
import 'package:palestine_plate/palestine_plate.dart';

void main() => runApp(const ExampleApp());

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    final spec = PSWestBankPlates.modernCar;
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Padding(
            padding: const EdgeInsets.all(16),
            child: PlateCanvas(
              spec: spec,
              // Colour is derived from usage, never chosen, and it is a
              // render-time input rather than a field on the spec.
              theme: PSThemes.forUsage(PSUsage.private),
              validator: const PSWestBankModernValidator(),
              autoValidate:
                  true, // paints red on an invalid plate; never blocks input
              // The trailing governorate letter is a `chosen` alphabet, so the
              // host is asked for a character instead of the slot accepting
              // typing. Returning null declines; `plate_gallery` wires
              // `plate_keypad`'s PlateCharacterPicker.show in here.
              onChooseCharacter: (alphabet) async => null,
            ),
          ),
        ),
      ),
    );
  }
}
2
likes
160
points
88
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Palestine's licence plates for the plate_core library — the West Bank and Gaza specs, the alphabets, the usage themes and the advisory validators.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, plate_alphabet, plate_core

More

Packages that depend on palestine_plate