Templates
A template is a finished scanner screen: glass buttons (close, torch, photo, zoom, camera switch), a hint, brackets that lock onto the code, and what happens next. Pass one to BarcodeScanner or scanBarcode:
dart
BarcodeScanner(
template: const ScannerTemplate.payment(),
onDetect: (capture) => print(capture.barcode.text),
)Every template takes your colours and texts (Colours and texts), and copyWith changes any of its settings (A ready-made screen). The screenshots below are the templates themselves, rendered by the package's tests.
MinimalScannerTemplate.minimal()Any code, with a sheet that shows what is in it; the default of scanBarcode.
PaymentScannerTemplate.payment()Paying with a QR code: the window high up, your payment sheet below.
RetailScannerTemplate.retail()Product and shipping barcodes in a row: dark glass, the torch, a list with counts.
TicketScannerTemplate.ticket()Boarding passes, tickets and IDs (PDF417, Aztec, QR, Data Matrix), your sheet with the fields.
ContentScannerTemplate.content()Everyday QR codes (links, Wi-Fi, contacts, events): dark glass, your actions such as Open or Connect.
ProductScannerTemplate.product()Products and books: EAN and UPC, a sheet with the GTIN or ISBN.
SmallScannerTemplate.small()Small codes on parts and boards: a small window, 2× zoom from the start.
Sign-inScannerTemplate.signIn()Signing in or pairing with a QR code on another screen: closes with the code accepted.
Check-inScannerTemplate.checkIn(check: ...)Tickets at the door: scanning never stops, a green, amber or red verdict for each code, a counter.
PharmaScannerTemplate.pharma()Medicine packs: GS1 Data Matrix with the GTIN, batch, serial and expiry date, marked when expired.
PickScannerTemplate.pick()Several codes in view or on a photo: no window, a label on every code, a tap picks one.
LogisticsScannerTemplate.logistics()Shipping labels: GS1-128 with SSCC, GTIN, quantity and batch in a list.
KioskScannerTemplate.kiosk()Self-service: the front camera, no buttons, large text, verdicts that hide by themselves.
FullscreenScannerTemplate.fullscreen()The whole camera without a window: the brackets appear on the code.
VINScannerTemplate.vin()Vehicle identification numbers on the windshield or the door pillar.
LoyaltyScannerTemplate.loyalty()Loyalty and membership cards: the card number large.