### Create Generic Scan Profile Source: https://github.com/rokke/scanwedge/blob/main/docs/AI_CONTEXT.md Creates a generic scan profile to configure the hardware scanner. This example enables Code 128 and QR Code symbologies. ```dart await _scanwedge?.createScanProfile( ProfileModel( profileName: 'MyInfoProfile', enabledBarcodes: [ BarcodeTypes.code128.create(), BarcodeTypes.qrCode.create(), ], ), ); ``` -------------------------------- ### Create Zebra Specific Scan Profile Source: https://github.com/rokke/scanwedge/blob/main/docs/AI_CONTEXT.md Creates a Zebra-specific scan profile with advanced configurations. This example enables Data Matrix, disables keyboard injection, and sets the aim type to trigger. ```dart await _scanwedge?.createScanProfile( ZebraProfileModel( profileName: 'MyZebraProfile', enabledBarcodes: [ BarcodeConfig(barcodeType: BarcodeTypes.datamatrix), ], enableKeyStroke: false, // Prevent keyboard injection aimType: AimType.trigger, // Control trigger behavior ), ); ``` -------------------------------- ### Scanwedge Initialization and Profile Creation Source: https://github.com/rokke/scanwedge/blob/main/README.md Demonstrates how to initialize the Scanwedge plugin and create a new scanner profile with specific barcode configurations. ```APIDOC ## Initialize and Create Profile ### Description Initializes the Scanwedge plugin and creates a new scanner profile. The profile can be configured to enable specific barcode types with length constraints. ### Method ```dart Scanwedge.initialize() createProfile(ProfileModel) ``` ### Parameters #### `Scanwedge.initialize()` No parameters. #### `createProfile(ProfileModel profileModel)` - **profileModel** (ProfileModel) - Required - An object defining the scanner profile, including name and enabled barcodes. ### ProfileModel This class sets the scan profile. ```dart ProfileModel({ required String profileName, List? enabledBarcodes, bool keepDefaults = true, }); ``` ### BarcodeConfig Configuration for barcode scanning. ```dart BarcodeConfig({ required BarcodeTypes barcodeType, int? minLength, int? maxLength, }); ``` ### Request Example ```dart final _scanwedgePlugin = await Scanwedge.initialize(); _scanwedgePlugin.createProfile(ProfileModel( profileName: 'TestProfile', enabledBarcodes: [BarcodeTypes.code128.create(minLength: 5, maxLength: 10)] )); ``` ``` -------------------------------- ### Initialize Scanwedge and Create Basic Profile Source: https://github.com/rokke/scanwedge/blob/main/README.md Initializes the Scanwedge plugin and creates a new scanner profile named 'TestProfile'. This profile is configured to only read CODE128 barcodes with a length between 5 and 10 characters. Ensure Scanwedge.initialize() is called before creating profiles. ```dart final _scanwedgePlugin = await Scanwedge.initialize(); //Creating a new profile with the name TestProfile that only reads CODE128 barcodes with the length between 5 and 10 _scanwedgePlugin.createProfile(ProfileModel(profileName: 'TestProfile', enabledBarcodes: [BarcodeTypes.code128.create(minLength: 5, maxLength: 10)])) ``` -------------------------------- ### Initialize Scanwedge Plugin Source: https://github.com/rokke/scanwedge/blob/main/docs/AI_CONTEXT.md Initializes the Scanwedge plugin. This must be called before using any other plugin functionalities. ```dart import 'package:scanwedge/scanwedge.dart'; Scanwedge? _scanwedge; Future initScanner() async { _scanwedge = await Scanwedge.initialize(); } ``` -------------------------------- ### Device and Scanner Control Commands Source: https://github.com/rokke/scanwedge/blob/main/README.md Provides documentation for commands related to device information, scanner enablement/disablement, and scanning control. ```APIDOC ## Device and Scanner Commands ### Description These commands allow you to retrieve device information, control the scanner's state, and trigger scans. ### Commands |Command|Description|Method Signature| |-|-|-| |**disableScanner**|Disables the scanner. For Honeywell devices, it will still "read" but not send the result.|`disableScanner()`| |**enableScanner**|Enables the scanner.|`enableScanner()`| |**isDeviceSupported**|Returns true if it's a supported device. If this is false, other methods will be ignored when called.|`isDeviceSupported()`| |**manufacturer**|Returns the manufacturer of the device.|`manufacturer()`| |**modelName**|Returns the model name of the device.|`modelName()`| |**osVersion**|Returns the OS version on the device.|`osVersion()`| |**packageName**|Returns the package name of the host application. This will also be used as the default package name in `ScanProfile` if not set.|`packageName()`| |**productName**|Returns the product name of the device.|`productName()`| |**supportedDevice**|Returns a `SupportedDevice` object with information about whether the device is supported and its type.|`supportedDevice()`| |**stream**|Requests a stream of barcode scans. Returns barcodes scanned with the `ScanResult`.|`stream()`| |**toggleScanning**|Triggers a scan (SOFTTRIGGER).|`toggleScanning()`| ``` -------------------------------- ### BarcodeConfig Constructor Source: https://github.com/rokke/scanwedge/blob/main/README.md Allows configuration of specific barcode scanning parameters. You can set the barcode type and optionally define minimum and maximum lengths for the scanned barcode. Note that length constraints may not be supported for all barcode types. ```dart BarcodeConfig({ required BarcodeTypes barcodeType, // The [BarcodeTypes] int? minLength, // The minimum length of the barcode, ignored if null. Not all barcode types support this so check hardware vendor for the appropriate barcode type int? maxLength, // The maximum length of the barcode, ignored if null. Not all barcode types support this so check hardware vendor for the appropriate barcode type }); ``` -------------------------------- ### ProfileModel Constructor Source: https://github.com/rokke/scanwedge/blob/main/README.md Defines the structure for setting a scan profile. It includes the profile name and an optional list of enabled barcode types. The 'keepDefaults' parameter determines if default hardware barcodes should also be enabled. ```dart ProfileModel({ required String profileName, // The name of the profile List? enabledBarcodes, // A list of [BarcodeConfig] that will be enabled in the profile bool keepDefaults = true, // If true, the default enabled barcodes from the hardware used will be kept (together with [enabledBarcodes]) }); ``` -------------------------------- ### Battery Status Commands Source: https://github.com/rokke/scanwedge/blob/main/README.md Details the commands for retrieving and monitoring the battery status of the device. ```APIDOC ## Battery Status Commands ### Description These commands allow you to get the current battery status and monitor changes in battery status. ### Commands |Command|Description|Method Signature| |-|-|-| |**getBatteryStatus**|Returns the battery status of the device. This function might be removed from this package in the future.|`getBatteryStatus()`| |**getExtendedBatteryStatus**|Returns the extended battery status of the device, providing more information than `getBatteryStatus`.|`getExtendedBatteryStatus()`| |**monitorBatteryStatus**|Starts monitoring the battery status. This will return a stream of `ExtendedBatteryStatus`.|`monitorBatteryStatus()`| |**stopMonitoringBatteryStatus**|Stops the battery status monitoring.|`stopMonitoringBatteryStatus()`| ``` -------------------------------- ### Listen for Scan Events with StreamBuilder Source: https://github.com/rokke/scanwedge/blob/main/README.md This snippet demonstrates how to listen for scan events from the Scanwedge plugin using a StreamBuilder. It displays the last scanned data or any errors encountered. ```dart final _scanwedgePlugin=ScanwedgeChannel(); @override build()=>Card( child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ const Text('Last scan:'), StreamBuilder( stream: _scanwedgePlugin.stream, builder: ((context, snapshot) => Text( snapshot.hasData ? snapshot.data.toString() : snapshot.hasError ? snapshot.error.toString() : 'Scan something', style: Theme.of(context).textTheme.titleMedium, ))) ] ) ); ``` -------------------------------- ### Control Scanner Operations Source: https://github.com/rokke/scanwedge/blob/main/docs/AI_CONTEXT.md Provides methods to control the scanner hardware, including simulating a soft trigger, disabling, and enabling the scanner. ```dart // Soft trigger (simulate pressing the hardware button) await _scanwedge?.toggleScanning(); // Disable the scanner hardware await _scanwedge?.disableScanner(); // Enable the scanner hardware await _scanwedge?.enableScanner(); ``` -------------------------------- ### Listen for Scan Results Source: https://github.com/rokke/scanwedge/blob/main/docs/AI_CONTEXT.md Subscribes to the scanwedge stream to receive barcode scan results. The stream provides ScanResult objects containing the barcode data and its type. ```dart _scanwedge?.stream.listen((ScanResult result) { print('Barcode: ${result.barcode}'); print('Type: ${result.barcodeType}'); // e.g., BarcodeTypes.code128 }); ``` -------------------------------- ### Monitor Battery Status Source: https://github.com/rokke/scanwedge/blob/main/docs/AI_CONTEXT.md Retrieves and monitors the battery status of the scanning device. This is particularly useful for enterprise-grade devices. ```dart // Get single status ExtendedBatteryStatus? status = await _scanwedge?.getExtendedBatteryStatus(); // Monitor changes _scanwedge?.monitorBatteryStatus()?.then((stream) { stream.listen((status) { print('Battery Level: ${status.batteryPercentage}%'); print('Health: ${status.health}'); }); }); ``` -------------------------------- ### BarcodeTypes Enum Source: https://github.com/rokke/scanwedge/blob/main/README.md This enum lists the supported barcode types that the scanner can recognize. It includes standard symbologies and special types for manual input or unknown formats. ```dart aztec, codabar, code128, code39, code93, datamatrix, ean128, ean13, ean8, gs1DataBar, gs1DataBarExpanded, i2of5, mailmark, maxicode, pdf417, qrCode, upca, upce0, manual, // Used for marking a barcode as manual input unknown // This is when it receives a unknown barcode, then check the [ScanResult.hardwareBarcodeType] for the actual barcode type ``` -------------------------------- ### AimTypes Enum for Scanner Source: https://github.com/rokke/scanwedge/blob/main/README.md This enum defines the aim types available for scanners on Zebra devices. Use these values to configure the scanner's aiming behavior. ```dart trigger timedHold timedRelease pressAndRelease presentation continuousRead pressAndSustain pressAndContinue timedContinuous ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.