scankit library

ScanKit - Modern barcode and QR code scanner for Flutter

A native-first barcode scanner using VisionKit on iOS and ML Kit on Android. Supports both embedded and full-screen scanning modes.

Quick Start

One-shot scan (opens full-screen scanner):

final result = await ScanKit.scan();
if (result != null) {
  print('Scanned: ${result.value}');
}

Embedded scanner widget:

ScanKitView(
  onDetect: (barcode) => print(barcode.value),
  overlay: const ScanKitOverlay.corners(),
)

Document scanning:

final result = await ScanKit.scanDocument();
if (result != null) {
  print('Scanned ${result.pageCount} pages');
}

Classes

BarcodeResult
Represents a scanned barcode result
DocumentScanResult
Result of document scanning
LiquidGlassOverlay
Premium liquid glass overlay with iOS-inspired design
ScanKit
Main entry point for ScanKit barcode and document scanner
ScanKitAnimatedOverlay
Animated overlay with moving scan line effect
ScanKitController
Controller for the embedded ScanKitView
ScanKitOverlay
Default overlay with corner brackets
ScanKitView
Embedded barcode scanner widget
ScannedPage
Represents a single scanned document page
ScanRegion
Scan region (normalized 0-1 coordinates)

Enums

BarcodeFormat
Supported barcode formats
CameraFacing
Camera facing direction
CameraResolution
Camera resolution preset

Exceptions / Errors

CameraPermissionDeniedException
Camera permission was denied by user
CameraPermissionRestrictedException
Camera access is restricted (parental controls, MDM, etc.)
DocumentScanFailedException
Document scanning failed
ImageProcessingException
Image processing failed (gallery/file scan)
ScanFailedException
Barcode scanning failed
ScanKitException
Base exception for all ScanKit errors
ScannerException
General scanner error
ScannerNotSupportedException
Device doesn't support barcode scanning
ScannerUnavailableException
Scanner UI could not be presented
TorchException
Torch/flash operation failed