Skip to content
11 changes: 11 additions & 0 deletions _includes/sidelist-programming/programming-flutter.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<li lang="flutter"><a class="otherLinkColour" href="{{ site.dbr_flutter }}driver-license-user-guide.html" style="cursor:pointer;color:#3c3c3c">Driver License Guide</a></li>
</ul>
</li>
<li lang="flutter"><a style="cursor:pointer;color:#3c3c3c">Explore Features</a>
<ul lang="flutter">
<li lang="flutter"><a class="otherLinkColour" href="{{ site.dbr_flutter }}explore-features/ui-customization.html" style="cursor:pointer;color:#3c3c3c">UI Customization</a></li>
</ul>
</li>
<li lang="flutter"><a href="{{ site.dbr_flutter }}samples/index.html" class="otherLinkColour">Demo &amp; Samples</a></li>

<li lang="flutter"><a href="{{ site.dbr_flutter_api }}barcode-scanner/index.html" style="cursor:pointer;color:#3c3c3c" class="otherLinkColour">BarcodeScanner API</a>
Expand Down Expand Up @@ -36,6 +41,9 @@
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/decoded-barcodes-result.html" class="otherLinkColour">DecodedBarcodesResult</a></li>
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/barcode-result-item.html" class="otherLinkColour">BarcodeResultItem</a></li>
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/camera-enhancer.html" class="otherLinkColour">CameraEnhancer</a></li>
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/camera-view.html" class="otherLinkColour">CameraView</a></li>
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/torch-button.html" class="otherLinkColour">TorchButton</a></li>
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/feedback.html" class="otherLinkColour">FeedBack</a></li>
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/license-manager.html" class="otherLinkColour">LicenseManager</a></li>
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/parsed-result.html" class="otherLinkColour">ParsedResult</a></li>
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/parsed-result-item.html" class="otherLinkColour">ParsedResultItem</a></li>
Expand All @@ -55,6 +63,9 @@
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}enum/captured-result-item-type.html" class="otherLinkColour">EnumCapturedResultItemType</a></li>
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}enum/mapping-status.html" class="otherLinkColour">EnumMappingStatus</a></li>
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}enum/validation-status.html" class="otherLinkColour">EnumValidationStatus</a></li>
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}enum/camera-position.html" class="otherLinkColour">EnumCameraPosition</a></li>
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}enum/enhanced-features-camera.html" class="otherLinkColour">EnumEnhancedFeatures</a></li>
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}enum/drawing-layer-id.html" class="otherLinkColour">EnumDrawingLayerId</a></li>
</ul>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class BarcodeResultItem

### format

The format of the barcode represented as [`EnumBarcodeFormat`](./enum/barcode-format.md).
The format of the barcode represented as a [`EnumBarcodeFormat`](./enum/barcode-format.md).

```dart
EnumBarcodeFormat format;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,28 @@ Future<void> open()

### setScanRegion

Sets the scan region of the camera and displays a bordered area on the UI to represent the scan region.
Sets the scan region of the camera and displays a bordered area on the UI to represent the scan region. To learn how to specify the scan region, please visit this [section of the foundational user guide](../../foundational-user-guide.md#specify-the-scan-region).

```dart
Future<void> setScanRegion( DSRect region )
```

**Remarks**

This method must be called **after [`setInput`](capture-vision-router.md#setinput) and before the [`open`](#open) method**.

### selectCamera

Selects the camera based on the specified [`EnumCameraPosition`](../enum/camera-position.md).

```dart
Future<void> selectCamera(EnumCameraPosition position)
```

**Remarks**

If you attempt to select the **backDualWideAuto** or the **backUltraWide** cameras on an Android phone, an exception will be thrown as those cameras are only available on iPhones. Supported devices include: iPhone 13 Pro, iPhone 13 Pro Max, iPhone 14 Pro, iPhone 14 Pro Max, iPhone 15 Pro, iPhone 15 Pro Max. This method must be called **after [`setInput`](capture-vision-router.md#setinput) and before the [`open`](#open) method**.

### setZoomFactor

Sets the zoom factor of the camera.
Expand All @@ -62,6 +78,32 @@ Turns off the camera's flashlight (if available).
Future<void> turnOffTorch()
```

### enableEnhancedFeatures

Activates the selected enhanced features (represented by [`EnumEnhancedFeatures`](../enum/enhanced-features-camera.md)) provided by the Camera Enhancer library, including the auto-zoom and smart torch features.

```dart
Future<void> enableEnhancedFeatures( int features )
```

**Remarks**

This method must be used **after [`setInput`](capture-vision-router.md#setinput) and before the [`open`](#open) method**. If you would like to activate multiple enhanced features, then they must be combined using the OR (`|`) operator.

```dart
await _cvr.setInput(_camera);
_camera.enableEnhancedFeatures(EnumEnhancedFeatures.autoZoom | EnumEnhancedFeatures.smartTorch);
_camera.open();
```

### disableEnhancedFeatures

Disables the selected and activated enhanced features (represented by [`EnumEnhancedFeatures`](../enum/enhanced-features-camera.md)) of the Camera Enhancer.

```dart
Future<void> disableEnhancedFeatures(int features)
```

### close

Closes the camera and releases the related resources. When the `CaptureVisionRouter` instance calls `stopCapturing`, please make sure to call this method as well to ensure that the resources are released properly.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
layout: default-layout
title: CameraView Class - Dynamsoft Capture Vision Flutter
description: CameraView class of DCV Flutter edition displays a camera preview with customizable UI elements.
keywords: camera, enhancer, barcode reader, flutter, capture vision, view
needGenerateH3Content: true
needAutoGenerateSidebar: true
noTitleIndex: true
---

# 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

```dart
class CameraView
```

## Properties

### cameraEnhancer

Sets the [`CameraEnhancer`](camera-enhancer.md) 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**.

```dart
final CameraEnhancer cameraEnhancer;
```

### scanLaserVisible

Determines whether the scan laser will be visible in the scan region or not.

```dart
final bool? scanLaserVisible;
```

### scanRegionMaskVisible

Establishes whether the scan region (if defined via the `CameraEnhancer`) will be represented visually using a mask. The mask highlights the area where the barcode scanning occurs, and it defaults to `true` if not specified.

```dart
final bool? scanRegionMaskVisible;
```

**Remarks**

To learn how to limit the scan region, please visit this [section of the foundational user guide](../../foundational-user-guide.md#specify-the-scan-region).

### torchButtonVisible

Controls the visibility of the torch/flash button that allows the user to activate the flash in low brightness scenarios.

```dart
final bool? torchButtonVisible;
```

**Remarks**

If no custom torch button is defined, the default torch icon will show up on the UI.

### torchButton

Defines a custom [`TorchButton`](torch-button.md) 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.

```dart
final TorchButton? torchButton;
```

## Code Snippet

```dart
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(backgroundColor: Theme.of(context).colorScheme.inversePrimary, title: Text(widget.title)),
body: Center(child: CameraView(
cameraEnhancer: _camera,
torchButtonVisible: true,
scanRegionMaskVisible: false,
scanLaserVisible: true,
torchButton: _torch,
visibleLayerIds: [EnumDrawingLayerId.dbr])
),
);
```
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Captures an image using the specified template and processes it - outputting a [
Future<CapturedResult> capture( ImageData imageData, String templateName )
```

#### Remarks
**Remarks**

The template that is used during processing can be a preset template (one of [`EnumPresetTemplate`](../enum/preset-template.md)) or a customized JSON template that you create or that is provided to you by the Dynamsoft team.

Expand All @@ -47,7 +47,7 @@ Starts the capturing process using the specified template. Any result(s) (of typ
Future<void> startCapturing( String templateName )
```

#### Remarks
**Remarks**

The template that is used during processing can be a preset template (one of [`EnumPresetTemplate`](../enum/preset-template.md)) or a customized JSON template that you create or that is provided to you by the Dynamsoft team.

Expand Down Expand Up @@ -79,3 +79,35 @@ Future<void> updateSettings( String templateName, SimplifiedCaptureVisionSetting

For the `templateName` input parameter, this can be either the name of the `CaptureVisionTemplate` in a custom JSON template file/string or the name of one of the preset templates available via [`EnumPresetTemplate`](../enum/preset-template.md).

### getSimplifiedSettings

Returns a subset of the full applied settings as a [`SimplifiedCaptureVisionSettings`](simplified-capture-vision-settings.md) object. This object contains the simplified settings of the Capture Vision Router instance, which in turn contains the simplified settings of the functional product used.

```dart
Future<SimplifiedCaptureVisionSettings?> getSimplifiedSettings(String templateName) async
```

**Remarks**

The templateName parameter represents the Capture Vision template that has been applied, whether it is a [preset template](../enum/preset-template.md) or a custom template defined in a JSON template file or string. To learn how to use the `getSimplifiedSettings`, please refer to this [section of the Foundational User Guide](../../foundational-user-guide.md#using-simplifiedcapturevisionsettings).

### resetSettings

Resets all of the settings to their default values.

```dart
Future<void> resetSettings() async
```

### setInput

Sets up an image source to provide images for continuous processing. This method is mainly used when configuring a camera (via the [`CameraEnhancer`](camera-enhancer.md)) as an input source.

```dart
Future<void> setInput(ImageSourceAdapter input) async
```

**Remarks**

In most cases, the `ImageSourceAdapter` that will be used is a Camera Enhancer instance to allow the user to use their phone's built-in camera. <!-- If there is a case where an external camera or image source is being used, please refer to Image -->

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class CapturedResultReceiver
| ------ | ----------- |
| [`onCapturedResultReceived`](#oncapturedresultreceived) | This callback is triggered when any kind of captured result is available at the end of the recognition process. |
| [`onDecodedBarcodesReceived`](#ondecodedbarcodesreceived) | This callback is triggered when decoded barcode(s) are available at the end of the recognition process. |
| [`onParsedResultsReceived`](#) | This callback is triggered when decoded barcode(s) are available at the end of the recognition process. |

### onCapturedResultReceived

Expand All @@ -50,3 +51,11 @@ Future<void> Function(DecodedBarcodesResult result)? onDecodedBarcodesReceived;
**Parameters**

`result`: The decoded barcode result, an instance of [`DecodedBarcodesResult`](decoded-barcodes-result.md).

### onParsedReultsReceived

This callback method delivers a ParsedResult, which is an object representing any captured result of type `parsedResult` that is taken from an image or a video frame. The callback is triggered each time an image finishes processing, regardless of whether there is a valid result or not.

```dart
Future<void> Function(ParsedResult result)? onParsedResultsReceived;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
layout: default-layout
title: FeedBack Class - Dynamsoft Capture Vision Flutter
description: FeedBack class of DCV Flutter provides API to control the haptic feedback features of a phone.
keywords: haptic, feedback, barcode reader, flutter, capture vision
needGenerateH3Content: true
needAutoGenerateSidebar: true
noTitleIndex: true
---

# FeedBack

The `FeedBack` class allows you to control the haptic feedback features so that the phone can either beep or vibrate when a result is found.

## Definition

*Assembly:* dynamsoft_capture_vision_flutter

```dart
class FeedBack
```

## Methods

### beep

Plays a beep sound when a captured result is found.

```dart
Future<void> beep()
```

### vibrate

Triggers a vibration when a captured result is found.

```dart
Future<void> vibrate()
```

**Code Snippet**

```dart
late final CapturedResultReceiver _receiver = CapturedResultReceiver()
..onDecodedBarcodesReceived = (DecodedBarcodesResult result) async {
if (result.items?.isNotEmpty ?? false) {
FeedBack.beep();
FeedBack.vibrate();
_cvr.stopCapturing();
var displayString = result.items?.map((item) => "Format: ${item.formatString}\nText: ${item.text}").join('\n\n');
showTextDialog("Barcodes Count: ${result.items?.length ?? 0}", displayString ?? "", () {
_cvr.startCapturing(_templateName);
});
}
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
layout: default-layout
title: TorchButton Class - Dynamsoft Capture Vision Flutter
description: TorchButton class of DCV Flutter edition represents a torch (flash) toggle button with customizable appearance and location.
keywords: camera, enhancer, barcode reader, flutter, torch, flash, button
needGenerateH3Content: true
needAutoGenerateSidebar: true
noTitleIndex: true
---

# TorchButton

`TorchButton` is a class that represents a torch (flashlight) toggle button - allowing the user to customize the torch button of the [`CameraView`](camera-view.md) how they see fit.

## Definition

*Assembly:* dynamsoft_capture_vision_flutter

```dart
class TorchButton
```

## Properties

### location

Sets the location of the torch button as a [Rect](https://api.flutter.dev/flutter/dart-ui/Rect-class.html) - this rectangle specifies the button's position and size on the screen. When creating a custom torch button, **this property must be set**.

```dart
Rect location;
```

**Remarks**

When setting the rectangle, please remember that the coordinates are in *pixels*.

### torchOnImageBase64

Sets the icon image (as a base64 string) that will be displayed when the torch is on.

```dart
String? torchOnImageBase64;
```

### torchOffImageBase64

Sets the icon image (as a base64 string) that will be displayed when the torch is off.

```dart
String? torchOffImageBase64;
```

## Code Snippet

```dart
final TorchButton _torch = TorchButton(
location: Rect.fromLTWH(300, 30, 50, 50), // places the torch button towards the top-right corner of the camera view
torchOffImageBase64: 'insert_base64_string_here',
torchOnImageBase64: 'insert_base64_string_here'
);
```
Loading