Skip to content

Commit 28f01f0

Browse files
Preview (#362)
* update to internal commit bf95b6f0 * update to internal commit 6f5d7b12 * update to internal commit 0af7d1ce * update to internal commit 94b73c05 * update to internal commit 0b1dce73 * update to internal commit 45935ba3 * update to internal commit e6f85863 * update to internal commit 5d3d3b6f * update to internal commit 460c0c40 --------- Co-authored-by: DMGithubPublisher <[email protected]>
1 parent 3f243bc commit 28f01f0

25 files changed

+588
-115
lines changed

_includes/sidelist-programming/programming-flutter.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
<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>
88
</ul>
99
</li>
10+
<li lang="flutter"><a style="cursor:pointer;color:#3c3c3c">Explore Features</a>
11+
<ul lang="flutter">
12+
<li lang="flutter"><a class="otherLinkColour" href="{{ site.dbr_flutter }}explore-features/ui-customization.html" style="cursor:pointer;color:#3c3c3c">UI Customization</a></li>
13+
</ul>
14+
</li>
1015
<li lang="flutter"><a href="{{ site.dbr_flutter }}samples/index.html" class="otherLinkColour">Demo &amp; Samples</a></li>
1116

1217
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}barcode-scanner/index.html" style="cursor:pointer;color:#3c3c3c" class="otherLinkColour">BarcodeScanner API</a>
@@ -36,6 +41,9 @@
3641
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/decoded-barcodes-result.html" class="otherLinkColour">DecodedBarcodesResult</a></li>
3742
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/barcode-result-item.html" class="otherLinkColour">BarcodeResultItem</a></li>
3843
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/camera-enhancer.html" class="otherLinkColour">CameraEnhancer</a></li>
44+
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/camera-view.html" class="otherLinkColour">CameraView</a></li>
45+
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/torch-button.html" class="otherLinkColour">TorchButton</a></li>
46+
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/feedback.html" class="otherLinkColour">FeedBack</a></li>
3947
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/license-manager.html" class="otherLinkColour">LicenseManager</a></li>
4048
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/parsed-result.html" class="otherLinkColour">ParsedResult</a></li>
4149
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}capture-vision-router-lite/parsed-result-item.html" class="otherLinkColour">ParsedResultItem</a></li>
@@ -55,6 +63,9 @@
5563
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}enum/captured-result-item-type.html" class="otherLinkColour">EnumCapturedResultItemType</a></li>
5664
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}enum/mapping-status.html" class="otherLinkColour">EnumMappingStatus</a></li>
5765
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}enum/validation-status.html" class="otherLinkColour">EnumValidationStatus</a></li>
66+
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}enum/camera-position.html" class="otherLinkColour">EnumCameraPosition</a></li>
67+
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}enum/enhanced-features-camera.html" class="otherLinkColour">EnumEnhancedFeatures</a></li>
68+
<li lang="flutter"><a href="{{ site.dbr_flutter_api }}enum/drawing-layer-id.html" class="otherLinkColour">EnumDrawingLayerId</a></li>
5869
</ul>
5970
</li>
6071
</ul>

programming/flutter/api-reference/capture-vision-router-lite/barcode-result-item.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class BarcodeResultItem
3737

3838
### format
3939

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

4242
```dart
4343
EnumBarcodeFormat format;

programming/flutter/api-reference/capture-vision-router-lite/camera-enhancer.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,28 @@ Future<void> open()
3232

3333
### setScanRegion
3434

35-
Sets the scan region of the camera and displays a bordered area on the UI to represent the scan region.
35+
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).
3636

3737
```dart
3838
Future<void> setScanRegion( DSRect region )
3939
```
4040

41+
**Remarks**
42+
43+
This method must be called **after [`setInput`](capture-vision-router.md#setinput) and before the [`open`](#open) method**.
44+
45+
### selectCamera
46+
47+
Selects the camera based on the specified [`EnumCameraPosition`](../enum/camera-position.md).
48+
49+
```dart
50+
Future<void> selectCamera(EnumCameraPosition position)
51+
```
52+
53+
**Remarks**
54+
55+
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**.
56+
4157
### setZoomFactor
4258

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

81+
### enableEnhancedFeatures
82+
83+
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.
84+
85+
```dart
86+
Future<void> enableEnhancedFeatures( int features )
87+
```
88+
89+
**Remarks**
90+
91+
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.
92+
93+
```dart
94+
await _cvr.setInput(_camera);
95+
_camera.enableEnhancedFeatures(EnumEnhancedFeatures.autoZoom | EnumEnhancedFeatures.smartTorch);
96+
_camera.open();
97+
```
98+
99+
### disableEnhancedFeatures
100+
101+
Disables the selected and activated enhanced features (represented by [`EnumEnhancedFeatures`](../enum/enhanced-features-camera.md)) of the Camera Enhancer.
102+
103+
```dart
104+
Future<void> disableEnhancedFeatures(int features)
105+
```
106+
65107
### close
66108

67109
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.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
layout: default-layout
3+
title: CameraView Class - Dynamsoft Capture Vision Flutter
4+
description: CameraView class of DCV Flutter edition displays a camera preview with customizable UI elements.
5+
keywords: camera, enhancer, barcode reader, flutter, capture vision, view
6+
needGenerateH3Content: true
7+
needAutoGenerateSidebar: true
8+
noTitleIndex: true
9+
---
10+
11+
# CameraView
12+
13+
`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.
14+
15+
## Definition
16+
17+
*Assembly:* dynamsoft_capture_vision_flutter
18+
19+
```dart
20+
class CameraView
21+
```
22+
23+
## Properties
24+
25+
### cameraEnhancer
26+
27+
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**.
28+
29+
```dart
30+
final CameraEnhancer cameraEnhancer;
31+
```
32+
33+
### scanLaserVisible
34+
35+
Determines whether the scan laser will be visible in the scan region or not.
36+
37+
```dart
38+
final bool? scanLaserVisible;
39+
```
40+
41+
### scanRegionMaskVisible
42+
43+
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.
44+
45+
```dart
46+
final bool? scanRegionMaskVisible;
47+
```
48+
49+
**Remarks**
50+
51+
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).
52+
53+
### torchButtonVisible
54+
55+
Controls the visibility of the torch/flash button that allows the user to activate the flash in low brightness scenarios.
56+
57+
```dart
58+
final bool? torchButtonVisible;
59+
```
60+
61+
**Remarks**
62+
63+
If no custom torch button is defined, the default torch icon will show up on the UI.
64+
65+
### torchButton
66+
67+
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.
68+
69+
```dart
70+
final TorchButton? torchButton;
71+
```
72+
73+
## Code Snippet
74+
75+
```dart
76+
@override
77+
Widget build(BuildContext context) {
78+
return Scaffold(
79+
appBar: AppBar(backgroundColor: Theme.of(context).colorScheme.inversePrimary, title: Text(widget.title)),
80+
body: Center(child: CameraView(
81+
cameraEnhancer: _camera,
82+
torchButtonVisible: true,
83+
scanRegionMaskVisible: false,
84+
scanLaserVisible: true,
85+
torchButton: _torch,
86+
visibleLayerIds: [EnumDrawingLayerId.dbr])
87+
),
88+
);
89+
```

programming/flutter/api-reference/capture-vision-router-lite/capture-vision-router.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Captures an image using the specified template and processes it - outputting a [
3535
Future<CapturedResult> capture( ImageData imageData, String templateName )
3636
```
3737

38-
#### Remarks
38+
**Remarks**
3939

4040
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.
4141

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

50-
#### Remarks
50+
**Remarks**
5151

5252
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.
5353

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

8080
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).
8181

82+
### getSimplifiedSettings
83+
84+
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.
85+
86+
```dart
87+
Future<SimplifiedCaptureVisionSettings?> getSimplifiedSettings(String templateName) async
88+
```
89+
90+
**Remarks**
91+
92+
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).
93+
94+
### resetSettings
95+
96+
Resets all of the settings to their default values.
97+
98+
```dart
99+
Future<void> resetSettings() async
100+
```
101+
102+
### setInput
103+
104+
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.
105+
106+
```dart
107+
Future<void> setInput(ImageSourceAdapter input) async
108+
```
109+
110+
**Remarks**
111+
112+
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 -->
113+

programming/flutter/api-reference/capture-vision-router-lite/captured-result-receiver.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class CapturedResultReceiver
2626
| ------ | ----------- |
2727
| [`onCapturedResultReceived`](#oncapturedresultreceived) | This callback is triggered when any kind of captured result is available at the end of the recognition process. |
2828
| [`onDecodedBarcodesReceived`](#ondecodedbarcodesreceived) | This callback is triggered when decoded barcode(s) are available at the end of the recognition process. |
29+
| [`onParsedResultsReceived`](#) | This callback is triggered when decoded barcode(s) are available at the end of the recognition process. |
2930

3031
### onCapturedResultReceived
3132

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

5253
`result`: The decoded barcode result, an instance of [`DecodedBarcodesResult`](decoded-barcodes-result.md).
54+
55+
### onParsedReultsReceived
56+
57+
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.
58+
59+
```dart
60+
Future<void> Function(ParsedResult result)? onParsedResultsReceived;
61+
```
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
layout: default-layout
3+
title: FeedBack Class - Dynamsoft Capture Vision Flutter
4+
description: FeedBack class of DCV Flutter provides API to control the haptic feedback features of a phone.
5+
keywords: haptic, feedback, barcode reader, flutter, capture vision
6+
needGenerateH3Content: true
7+
needAutoGenerateSidebar: true
8+
noTitleIndex: true
9+
---
10+
11+
# FeedBack
12+
13+
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.
14+
15+
## Definition
16+
17+
*Assembly:* dynamsoft_capture_vision_flutter
18+
19+
```dart
20+
class FeedBack
21+
```
22+
23+
## Methods
24+
25+
### beep
26+
27+
Plays a beep sound when a captured result is found.
28+
29+
```dart
30+
Future<void> beep()
31+
```
32+
33+
### vibrate
34+
35+
Triggers a vibration when a captured result is found.
36+
37+
```dart
38+
Future<void> vibrate()
39+
```
40+
41+
**Code Snippet**
42+
43+
```dart
44+
late final CapturedResultReceiver _receiver = CapturedResultReceiver()
45+
..onDecodedBarcodesReceived = (DecodedBarcodesResult result) async {
46+
if (result.items?.isNotEmpty ?? false) {
47+
FeedBack.beep();
48+
FeedBack.vibrate();
49+
_cvr.stopCapturing();
50+
var displayString = result.items?.map((item) => "Format: ${item.formatString}\nText: ${item.text}").join('\n\n');
51+
showTextDialog("Barcodes Count: ${result.items?.length ?? 0}", displayString ?? "", () {
52+
_cvr.startCapturing(_templateName);
53+
});
54+
}
55+
};
56+
```
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
layout: default-layout
3+
title: TorchButton Class - Dynamsoft Capture Vision Flutter
4+
description: TorchButton class of DCV Flutter edition represents a torch (flash) toggle button with customizable appearance and location.
5+
keywords: camera, enhancer, barcode reader, flutter, torch, flash, button
6+
needGenerateH3Content: true
7+
needAutoGenerateSidebar: true
8+
noTitleIndex: true
9+
---
10+
11+
# TorchButton
12+
13+
`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.
14+
15+
## Definition
16+
17+
*Assembly:* dynamsoft_capture_vision_flutter
18+
19+
```dart
20+
class TorchButton
21+
```
22+
23+
## Properties
24+
25+
### location
26+
27+
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**.
28+
29+
```dart
30+
Rect location;
31+
```
32+
33+
**Remarks**
34+
35+
When setting the rectangle, please remember that the coordinates are in *pixels*.
36+
37+
### torchOnImageBase64
38+
39+
Sets the icon image (as a base64 string) that will be displayed when the torch is on.
40+
41+
```dart
42+
String? torchOnImageBase64;
43+
```
44+
45+
### torchOffImageBase64
46+
47+
Sets the icon image (as a base64 string) that will be displayed when the torch is off.
48+
49+
```dart
50+
String? torchOffImageBase64;
51+
```
52+
53+
## Code Snippet
54+
55+
```dart
56+
final TorchButton _torch = TorchButton(
57+
location: Rect.fromLTWH(300, 30, 50, 50), // places the torch button towards the top-right corner of the camera view
58+
torchOffImageBase64: 'insert_base64_string_here',
59+
torchOnImageBase64: 'insert_base64_string_here'
60+
);
61+
```

0 commit comments

Comments
 (0)