Speed up SparkScan integration with Agent Skills
Install the Scandit plugin and use the /sparkscan-flutter skill so that your AI coding agent can integrate, debug, and customize SparkScan on Flutter following Scandit's recommended patterns. More info →
Run the following command in your project directory. It detects the supported coding agents you have installed and adds the Scandit plugin to each. Re-run it to update.
npx plugins add scandit/skillsPrefer to set it up yourself? Manual installation steps for each agent →
SparkScan settings reference
This page lists the SparkScan settings and view properties in Flutter, with their defaults and allowed values as the API reference states them. A blank default means the API reference states none. For what the workflow settings do for your users, see How SparkScan works.
Options
SparkScanSettings
SparkScanSettings holds the scanning settings, such as the enabled symbologies. To change them on a running scanner, pass them to SparkScan.applySettings().
| Name | Type | Default | Values | What it does |
|---|---|---|---|---|
SparkScanSettings({capturePresets}) | Constructor | Set<CapturePreset>? | Creates settings, optionally from presets that enable the matching symbologies and optimizations. Presets added in 8.3.0. | |
codeDuplicateFilter | Duration | -2 | -2: depends on scanIntention. -1: not reported again until scanning stops. 0: no filtering. Greater than 0: the time before the same code is reported again. | Filters out codes with the same symbology and data that are scanned again within the interval. If you keep the default and turn the selection mode On, SparkScan doesn't filter duplicates, so users can select the same barcode again. |
enabledSymbologies | Set<Symbology> | Empty: all symbologies are disabled | Read-only. The enabled symbologies. | |
enableSymbology(symbology, enabled) | Method | Enables or disables one symbology. | ||
enableSymbologies(symbologies) | Method | Enables a set of symbologies. | ||
settingsForSymbology(symbology) | Method | Returns the SymbologySettings of one symbology, for example to change its active symbol counts. | ||
enabledCompositeTypes | Set<CompositeType> | The composite code types to scan. Added in 8.3.0. | ||
enableSymbologiesForCompositeTypes(compositeTypes) | Method | Enables the symbologies that the given composite types need. Added in 8.3.0. | ||
batterySaving | BatterySavingMode | auto | on, off, auto | The battery saving mode. auto turns it on when battery use is higher than usual. |
scanIntention | ScanIntention | smart | smart, manual | Whether SparkScan identifies the barcode the user intends to scan. It has no effect while selectionMode is on. |
selectionMode | SelectionMode | auto | auto, on, off | Whether users confirm the aimed barcode with the trigger button. Added in 8.5.0. |
itemDefinitions | List<ScanItemDefinition>? | Configures the settings with the item-based scanning API. When set, enabledSymbologies is ignored. Beta. Added in 8.1.0. | ||
setProperty(name, value) | Method | Sets a property that isn't part of the stable API yet. | ||
getProperty(name) | Method | Returns the value of a property set with setProperty(). |
SparkScanViewSettings
SparkScanViewSettings sets the view's default look and behavior. Set them before you create the SparkScanView. Changes after that don't apply to the view.
| Name | Type | Default | Values | What it does |
|---|---|---|---|---|
scanningBehavior | SparkScanScanningBehavior | single | single, continuous | Whether users scan one barcode per trigger or keep scanning. Added in 8.7.0. |
previewBehavior | SparkScanPreviewBehavior | defaultBehaviour | defaultBehaviour, persistent | Whether the mini preview hides or stays visible when the scanner isn't scanning. Added in 8.7.0. |
holdToScanEnabled | bool | true | Whether users can keep scanning by holding the trigger button. Ignored while selectionMode is on. | |
triggerButtonCollapseTimeout | Duration | 5 seconds | A negative value: never | The time after which the trigger button collapses to its idle state. |
inactiveStateTimeout | Duration | 10 seconds | The time after which scanning stops on its own. | |
defaultTorchState | TorchState | off | on, off, auto | The torch state when the camera starts. |
defaultCameraPosition | CameraPosition | worldFacing | worldFacing, userFacing, unspecified | The camera to start with. Beta. |
defaultMiniPreviewSize | SparkScanMiniPreviewSize | regular | regular, expanded | The size of the mini preview when it first shows. |
zoomFactorOut | double | 1 | The camera zoom factor. | |
zoomFactorIn | double | 2 | The zoom factor after users tap the zoom switch control. | |
soundEnabled | bool | true | Whether the scan feedback plays a sound. | |
hapticEnabled | bool | true | Whether the scan feedback vibrates. | |
visualFeedbackEnabled | bool | true | Whether the screen flashes on scan. | |
hardwareTriggerEnabled | bool | Whether a hardware button starts scanning. | ||
hardwareTriggerKeyCode | int? | null: the dedicated button on XCover devices, or volume down on other devices | The button that starts scanning. Applies on Android only. | |
toastSettings | SparkScanToastSettings | The toast messages the mini preview shows. | ||
selectionModeCandidateBrush | Brush? | null: the default brush | The brush that highlights candidate barcodes while selectionMode is auto. Added in 8.5.0. | |
shouldShowOnTopAlways | bool | true | Whether the SparkScanView always stays on top of the Flutter content. iOS only. | |
periscopeModeEnabled | bool | false | Mirrors the camera feed for a periscope device. iOS only. Added in 8.3.0. |
SparkScanView properties
You set these properties on the SparkScanView widget, or pass most of them as named parameters of the SparkScanView constructor. To set the UI listener, call setListener().
| Name | Type | Default | Values | What it does |
|---|---|---|---|---|
feedbackDelegate | SparkScanFeedbackDelegate? | Decides the feedback for each scanned barcode. Without a delegate, every scan gets the success feedback. | ||
feedbackExtendedDelegate | SparkScanFeedbackExtendedDelegate? | Like feedbackDelegate, and also decides the feedback for scanned items. Set this one or feedbackDelegate, not both. Added in 8.2.0. | ||
hardwareTriggerSupported | bool, static | Read-only. Whether the device supports hardware buttons: true from Android API level 28. Android only. | ||
triggerButtonVisible | bool | true | Shows the trigger button. | |
triggerButtonImage | Image? | The image in the trigger button. | ||
triggerButtonCollapsedColor | Color? | The background color of the collapsed trigger button. | ||
triggerButtonExpandedColor | Color? | The background color of the expanded trigger button. | ||
triggerButtonAnimationColor | Color? | The color of the pulsing animation around the trigger button while the scanner is active. | ||
triggerButtonTintColor | Color? | The tint color of the trigger button. | ||
previewSizeControlVisible | bool | true | Shows the control that resizes the mini preview. | |
previewCloseControlVisible | bool | true | Shows the control that closes the mini preview. | |
torchControlVisible | bool | true | Shows the torch control. Hidden when defaultTorchState is auto. | |
zoomSwitchControlVisible | bool | true | Shows the zoom switch control. | |
scanningBehaviorButtonVisible | bool | false | Shows the toolbar button that switches between single and continuous scanning. | |
selectionModeButtonVisible | bool | false | Shows the toolbar button that switches selectionMode between on and off. Added in 8.5.0. | |
cameraSwitchButtonVisible | bool | false | Shows the toolbar button that switches between the world-facing and user-facing cameras. Beta. | |
barcodeCountButtonVisible | bool | false | Shows the toolbar button for MatrixScan Count. | |
barcodeFindButtonVisible | bool | false | Shows the toolbar button for MatrixScan Find. | |
labelCaptureButtonVisible | bool | false | Shows the toolbar button for Smart Label Capture. | |
toolbarBackgroundColor | Color? | null | The background color of the settings toolbar. | |
toolbarIconActiveTintColor | Color? | null | The color of active toolbar icons. | |
toolbarIconInactiveTintColor | Color? | null | The color of inactive toolbar icons. |
Framework differences
In Flutter, these options differ from the other SparkScan frameworks:
scanningBehaviorandpreviewBehaviorwere added in 8.7.0. On iOS, Android and Web, they were added in 8.5.0.shouldShowOnTopAlwaysexists only in Flutter, and works on iOS only.feedbackExtendedDelegateexists only in Flutter. It also decides the feedback for scanned items.periscopeModeEnabledworks on iOS only.