CameraView
CameraView is a widget that integrates with the CameraEnhancer - providing a camera interface with configurable and customizable UI components like torch control, scan region visualization, and custom drawing layers.
Definition
Assembly: dynamsoft_capture_vision_flutter
class CameraView extends StatefulWidget
Constructors
const CameraView({
super.key,
required this.cameraEnhancer,
this.torchButtonVisible,
this.scanRegionMaskVisible,
this.scanLaserVisible,
this.torchButton,
this.visibleLayerIds,
this.cameraToggleButtonVisible,
this.cameraToggleButton,
});
Properties
| Property | Description |
|---|---|
cameraEnhancer |
Sets the CameraEnhancer instance that the CameraView is attached to. |
cameraToggleButton |
Defines a custom widget to replace the default camera toggle button. |
cameraToggleButtonVisible |
Determines whether the camera toggle button is visible. |
scanLaserVisible |
Determines whether the scan laser will be visible in the scan region. |
scanRegionMaskVisible |
Determines whether the scan region mask will be visible. (Scan region mask is a mask covered outside the scan region.) |
torchButtonVisible |
Controls the visibility of the torch/flash button. |
torchButton |
Defines a custom TorchButton instead of the default torch icon. |
visibleLayerIds |
Defines which drawing layer(s) to display on the camera view. |
cameraEnhancer
Sets the CameraEnhancer instance that the CameraView is attached to. The CameraEnhancer is responsible for the core camera operations, and so this property must be defined when constructing the CameraView.
final CameraEnhancer cameraEnhancer;
cameraToggleButton
Defines a custom widget (as a CameraToggleButton object) to replace the default camera toggle button (to switch between the front and back cameras).
final CameraToggleButton? cameraToggleButton;
cameraToggleButtonVisible
Determines whether the camera toggle button (to switch between the front and back cameras) is visible.
final bool? cameraToggleButtonVisible;
Remarks
Default value is false.
scanLaserVisible
Determines whether the scan laser will be visible in the scan region or not.
final bool? scanLaserVisible;
Remarks
Defaults to true if not specified.
scanRegionMaskVisible
Determines whether the scan region mask will be visible. Scan region mask is a mask covered outside the scan region.
final bool? scanRegionMaskVisible;
Remarks
To learn how to limit the scan region, please visit this section of the foundational user guide. Defaults to true if not specified.
torchButtonVisible
Controls the visibility of the torch/flash button that allows the user to activate the flash in low brightness scenarios.
final bool? torchButtonVisible;
Remarks
If no custom torch button is defined, the default torch icon will show up on the UI. Defaults to true if not specified.
torchButton
Defines a custom TorchButton instead of the default torch icon that comes with the camera view. This property allows you to customize the size, position, and icon images of the torch button.
final TorchButton? torchButton;
visibleLayerIds
Defines which drawing layer(s) (see EnumDrawingLayerId) to display on the camera view. The drawing layer is responsible for highlighting the captured result, so in the case of the Barcode Reader, the drawing layer would highlight any recognized barcodes.
final List<EnumDrawingLayerId>? visibleLayerIds;
Remarks
The Capture Vision library can work with multiple functional products, including the Barcode Reader, Label Recognizer, and the Document Normalizer. If you would like to disable the feature to highlight any found barcodes, then the visibleLayerIds must not include EnumDrawingLayerId.dbr.