From 6f6c84e9525e0485c4e2fb1e5be344839af54a01 Mon Sep 17 00:00:00 2001 From: DMGithubPublisher Date: Thu, 25 Sep 2025 04:16:16 +0800 Subject: [PATCH 1/9] update to internal commit bf95b6f0 --- _config.yml | 5 + _data/full_tree.yml | 1 + _includes/sidelist-full-tree.html | 6 +- .../programming-flutter.html | 394 ++++++++++++++++++ index.md | 4 +- .../api-reference/barcode-result-item.md | 116 ++++++ .../barcode-scanner/barcode-scan-result.md | 71 ++++ .../barcode-scanner/barcode-scanner-config.md | 249 +++++++++++ .../barcode-scanner/barcode-scanner.md | 61 +++ .../camera-enhancer.md | 79 ++++ .../capture-vision-router.md | 81 ++++ .../captured-result-receiver.md | 52 +++ .../captured-result.md | 74 ++++ .../decoded-barcodes-result.md | 44 ++ .../license-manager.md | 42 ++ .../simplified-barcode-reader-settings.md | 153 +++++++ .../simplified-capture-vision-settings.md | 97 +++++ .../api-reference/enum/barcode-format.md | 120 ++++++ .../enum/captured-result-item-type.md | 50 +++ .../flutter/api-reference/enum/deblur-mode.md | 47 +++ .../enum/grayscale-enhancement-mode.md | 37 ++ .../enum/grayscale-transformation-mode.md | 33 ++ .../api-reference/enum/localization-mode.md | 50 +++ .../api-reference/enum/preset-template.md | 29 ++ .../api-reference/enum/result-status.md | 26 ++ .../api-reference/enum/scanning-mode.md | 25 ++ programming/flutter/api-reference/index.md | 71 ++++ .../flutter/driver-license-user-guide.md | 356 ++++++++++++++++ .../flutter/foundational-user-guide.md | 291 +++++++++++++ programming/flutter/index.md | 73 ++++ programming/flutter/release-notes/index.md | 24 ++ programming/flutter/samples/index.md | 41 ++ programming/flutter/upgrade.md | 56 +++ programming/flutter/user-guide.md | 289 +++++++++++++ 34 files changed, 3144 insertions(+), 3 deletions(-) create mode 100644 _includes/sidelist-programming/programming-flutter.html create mode 100644 programming/flutter/api-reference/barcode-result-item.md create mode 100644 programming/flutter/api-reference/barcode-scanner/barcode-scan-result.md create mode 100644 programming/flutter/api-reference/barcode-scanner/barcode-scanner-config.md create mode 100644 programming/flutter/api-reference/barcode-scanner/barcode-scanner.md create mode 100644 programming/flutter/api-reference/capture-vision-router-lite/camera-enhancer.md create mode 100644 programming/flutter/api-reference/capture-vision-router-lite/capture-vision-router.md create mode 100644 programming/flutter/api-reference/capture-vision-router-lite/captured-result-receiver.md create mode 100644 programming/flutter/api-reference/capture-vision-router-lite/captured-result.md create mode 100644 programming/flutter/api-reference/capture-vision-router-lite/decoded-barcodes-result.md create mode 100644 programming/flutter/api-reference/capture-vision-router-lite/license-manager.md create mode 100644 programming/flutter/api-reference/capture-vision-router-lite/simplified-barcode-reader-settings.md create mode 100644 programming/flutter/api-reference/capture-vision-router-lite/simplified-capture-vision-settings.md create mode 100644 programming/flutter/api-reference/enum/barcode-format.md create mode 100644 programming/flutter/api-reference/enum/captured-result-item-type.md create mode 100644 programming/flutter/api-reference/enum/deblur-mode.md create mode 100644 programming/flutter/api-reference/enum/grayscale-enhancement-mode.md create mode 100644 programming/flutter/api-reference/enum/grayscale-transformation-mode.md create mode 100644 programming/flutter/api-reference/enum/localization-mode.md create mode 100644 programming/flutter/api-reference/enum/preset-template.md create mode 100644 programming/flutter/api-reference/enum/result-status.md create mode 100644 programming/flutter/api-reference/enum/scanning-mode.md create mode 100644 programming/flutter/api-reference/index.md create mode 100644 programming/flutter/driver-license-user-guide.md create mode 100644 programming/flutter/foundational-user-guide.md create mode 100644 programming/flutter/index.md create mode 100644 programming/flutter/release-notes/index.md create mode 100644 programming/flutter/samples/index.md create mode 100644 programming/flutter/upgrade.md create mode 100644 programming/flutter/user-guide.md diff --git a/_config.yml b/_config.yml index df8d0b5a..8669ffff 100644 --- a/_config.yml +++ b/_config.yml @@ -58,10 +58,12 @@ react_native_api: /capture-vision/docs-archive/mobile/programming/react-native/a dbr_android_api: /barcode-reader/docs/mobile/programming/android/api-reference/ dcv_android_api: /capture-vision/docs-archive/mobile/programming/android/api-reference/ dcvb_android_api: /capture-vision/docs/mobile/programming/android/api-reference/ +dcvb_android_release_notes: /capture-vision/docs/mobile/programming/android/release-notes/ dbr_ios_api: /barcode-reader/docs/mobile/programming/objectivec-swift/api-reference/ dcv_ios_api: /capture-vision/docs-archive/mobile/programming/ios/api-reference/ dcvb_ios_api: /capture-vision/docs/mobile/programming/ios/api-reference/ +dcvb_ios_release_notes: /capture-vision/docs/mobile/programming/ios/release-notes/ dbr_maui: /barcode-reader/docs/mobile/programming/maui/ dbr_maui_v10: /barcode-reader/docs/v10/mobile/programming/maui/ @@ -73,6 +75,9 @@ dce_maui_api: /camera-enhancer/docs/mobile/programming/maui/api-reference/ dcp_maui: /code-parser/docs/mobile/programming/maui/ dcp_maui_api: /code-parser/docs/mobile/programming/maui/api-reference/ +dbr_flutter: /barcode-reader/docs/mobile/programming/flutter/ +dbr_flutter_api: /barcode-reader/docs/mobile/programming/flutter/api-reference/ + dcv_enumerations: /capture-vision/docs-archive/core/enums/ dcv_parameters_reference: /capture-vision/docs-archive/core/parameters/reference/ dcv_introduction: /capture-vision/docs-archive/core/introduction/ diff --git a/_data/full_tree.yml b/_data/full_tree.yml index 0eaa33cd..bb07ee82 100644 --- a/_data/full_tree.yml +++ b/_data/full_tree.yml @@ -3,3 +3,4 @@ tree_file_list: - sidelist-programming/programming-android.html - sidelist-programming/programming-oc.html - sidelist-programming/programming-maui.html + - sidelist-programming/programming-flutter.html diff --git a/_includes/sidelist-full-tree.html b/_includes/sidelist-full-tree.html index 1858cc8f..22d9fbb1 100644 --- a/_includes/sidelist-full-tree.html +++ b/_includes/sidelist-full-tree.html @@ -9,4 +9,8 @@
  • DBR-MAUI Introduction
  • -{%- include liquid_searchVersionTreeFile.html ver=include.ver curPath=include.curPath targetRelativePath="sidelist-programming/programming-maui.html" -%} \ No newline at end of file +{%- include liquid_searchVersionTreeFile.html ver=include.ver curPath=include.curPath targetRelativePath="sidelist-programming/programming-maui.html" -%} +
  • + DBR-Flutter Introduction +
  • +{%- include liquid_searchVersionTreeFile.html ver=include.ver curPath=include.curPath targetRelativePath="sidelist-programming/programming-flutter.html" -%} diff --git a/_includes/sidelist-programming/programming-flutter.html b/_includes/sidelist-programming/programming-flutter.html new file mode 100644 index 00000000..e7f5da0d --- /dev/null +++ b/_includes/sidelist-programming/programming-flutter.html @@ -0,0 +1,394 @@ +
  • DEVELOPMENT
  • + +
  • User Guide + +
  • +
  • Demo & Samples
  • + +
  • BarcodeScanner API + +
  • +
  • Foundational API + +
  • + +
  • UNDERSTANDING DBR
  • +
  • Architecture + +
  • +
  • Performance + +
  • + +
  • Parameters + +
  • + +
  • USEFUL RESOURCES
  • +
  • Release Notes
  • + +
  • OTHER EDITIONS
  • +
  • Develop for Android (Java & Kotlin)
  • +
  • Develop for iOS (Objective-C & Swift)
  • +
  • Develop for MAUI
  • +
  • Develop for React Native
  • diff --git a/index.md b/index.md index f03d00fc..710ccb71 100644 --- a/index.md +++ b/index.md @@ -13,10 +13,10 @@ description: Dynamsoft Barcode Reader Mobile SDK Documentation Homepage - ![iOS Icon]({{site.assets}}img-icon/homepage/iOS.svg){:class="ios"} [iOS]({{ site.oc }}){:target="_blank"} - ![Android Icon]({{site.assets}}img-icon/homepage/Android.svg){:class="android"} [Android]({{ site.android }}){:target="_blank"} - ![MAUI Icon]({{site.assets}}img-icon/homepage/MAUI.svg){:class="maui"} [MAUI]({{ site.dbr_maui }}){:target="_blank"} - +- ![Flutter Icon]({{site.assets}}img-icon/homepage/Flutter.svg){:class="flutter"} [Flutter]({{ site.dbr_flutter }}){:target="_blank"} +-
    - ![React Native Icon]({{site.assets}}img-icon/homepage/React Native.svg){:class="react"} [React Native](https://www.dynamsoft.com/capture-vision/docs/programming/react-native/){:target="_blank"} -- ![Flutter Icon]({{site.assets}}img-icon/homepage/Flutter.svg){:class="flutter"} [Flutter](https://www.dynamsoft.com/capture-vision/docs/programming/flutter/){:target="_blank"} - ![Xamarin.Forms Icon]({{site.assets}}img-icon/homepage/Xamarin Forms.svg){:class="xamarin"} [Xamarin.Forms](https://www.dynamsoft.com/capture-vision/docs/programming/xamarin/){:target="_blank"} - ![Cordova Icon]({{site.assets}}img-icon/homepage/Cordova.svg){:class="cordova"} [Cordova](https://www.dynamsoft.com/capture-vision/docs/programming/cordova/){:target="_blank"} \ No newline at end of file diff --git a/programming/flutter/api-reference/barcode-result-item.md b/programming/flutter/api-reference/barcode-result-item.md new file mode 100644 index 00000000..6ccab5ff --- /dev/null +++ b/programming/flutter/api-reference/barcode-result-item.md @@ -0,0 +1,116 @@ +--- +layout: default-layout +title: BarcodeResultItem Class - Dynamsoft Barcode Reader Flutter Edition +description: BarcodeResultItem class represents a barcode result item decoded by barcode reader engine. It is derived from CapturedResultItem. +keywords: GetFormat, GetText, GetLocation, GetConfidence, GetModuleSize, BarcodeResultItem, api reference, flutter, barcode reader +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: BarcodeResultItem +--- + +# BarcodeResultItem Class + +The `BarcodeResultItem` class represents a single barcode result decoded by the barcode reader. It is part of the [`DecodedBarcodesResult`](../api-reference/capture-vision-router-lite/decoded-barcodes-result.md), which is what the library outputs at the end of the barcode recognition process. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +class BarcodeResultItem +``` + +## Properties + +| Property | Type | Description | +| -------- | ---- | ----------- | +| [`format`](#format) | *[EnumBarcodeFormat](./enum/barcode-format.md)* | The format of the barcode represented as [`EnumBarcodeFormat`](./enum/barcode-format.md). | +| [`formatString`](#formatstring) | *String* | The format of the barcode as a text string. | +| [`text`](#text) | *String* | The decoded text of the barcode. | +| [`bytes`](#bytes) | *Uint8List* | The raw bytes of the barcode. | +| [`location`](#location) | *Quadrilateral* | The location of the barcode in the image/frame. | +| [`confidence`](#confidence) | *int* | The confidence of the barcode result. | +| [`angle`](#angle) | *int* | The angle at which the barcode is detected if it's not aligned in the image/frame. | +| [`moduleSize`](#modulesize) | *int* | The size of the smallest module (dot or line) of the barcode. | +| [`isDPM`](#isdpm) | *bool* | Indicates whether the barcode is a Dot Peen Marking (DPM). | +| [`isMirrored`](#ismirrored) | *bool* | Indicates whether the barcode image is mirrored. | + +### format + +The format of the barcode represented as [`EnumBarcodeFormat`](./enum/barcode-format.md). + +```dart +EnumBarcodeFormat format; +``` + +### formatString + +The format of the barcode as a text string instead of a `EnumBarcodeFormat`. + +```dart +String formatString; +``` + +### text + +The decoded text of the barcode. + +```dart +String text; +``` + +### bytes + +The raw bytes of the barcode. + +```dart +Uint8List bytes; +``` + +### location + +The location of the barcode in the image/frame as a `Quadrilateral`. The quadrilateral contains the four vertex points of the location, with the first vertex being the left-most vertex, then going in a clockwise direction for the remaining points. + +```dart +Quadrilateral location; +``` + +### confidence + +The confidence of the barcode result is a measure of the result's accuracy. If the confidence is lower than 30, the result will not be output by default as it is considered quite inaccurate. + +```dart +int confidence; +``` + +### angle + +The angle at which the barcode is detected if it's not aligned in the image/frame. + +```dart +int angle; +``` + +### moduleSize + +The size of the smallest module (dot or line) of the barcode. + +```dart +int moduleSize; +``` + +### isDPM + +Indicates whether the barcode is a Dot Peen Marking (DPM), which is a unique type of Datamatrix code. + +```dart +bool isDPM; +``` + +### isMirrored + +Indicates whether the barcode image is mirrored. + +```dart +bool isMirrored; +``` diff --git a/programming/flutter/api-reference/barcode-scanner/barcode-scan-result.md b/programming/flutter/api-reference/barcode-scanner/barcode-scan-result.md new file mode 100644 index 00000000..36d35872 --- /dev/null +++ b/programming/flutter/api-reference/barcode-scanner/barcode-scan-result.md @@ -0,0 +1,71 @@ +--- +layout: default-layout +title: BarcodeScanResult Class - Dynamsoft Barcode Reader Flutter Edition +description: BarcodeScanResult of Dynamsoft Barcode Reader Flutter is a result class that contains all the decoded barcodes. +keywords: barcode, scanner, scan result +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: BarcodeScanResult +--- + +# BarcodeScanResult + +`BarcodeScanResult` is a result class that contains all the decoded barcodes and their associated info. + +## Definition + +*Assembly:* dynamsoft-barcode-reader-bundle-flutter + + +```dart +class BarcodeScanResult +``` + +## Properties + +| Property | Type | Description | +| -------- | ---- | ----------- | +| [`barcodes`](#barcodes) | [*List*](../barcode-result-item.md) | Represents all the decoded barcodes in an array of [`BarcodeResultItem`](../barcode-result-item.md). | +| [`status`](#status) | [*EnumResultStatus*](../enum/result-status.md) | Represents the result status, which can be finished, canceled or exception. | +| [`errorCode`](#errorcode) | *int* | Represents the error code should something go wrong during the barcode scanning process. | +| [`errorString`](#errorstring) | *string* | Represents the error message associated with the error code should something go wrong during the barcode scanning process. | + +### barcodes + +Represents all the decoded barcodes in an array of [`BarcodeResultItem`](../barcode-result-item.md). + +```dart +List? barcodes; +``` + +**See also** + +- [`BarcodeResultItem`](../barcode-result-item.md). + +### status + +Represents the status of the result, which can be finished, canceled or exception. + +```dart +EnumResultStatus resultStatus; +``` + +- `EnumResultStatus.finished`: The barcode scanning is finished. +- `EnumResultStatus.canceled`: The barcode scanning activity is closed before the process is finished. +- `EnumResultStatus.exception`: Failed to start barcode scanning or an error occurs when scanning the barcode. + +### errorCode + +Represents the error code should something go wrong during the barcode scanning process. In this case, the result status is `EnumResultStatus.exception`. + +```dart +int? errorCode; +``` + +### errorString + +Represents the error message associated with the error code should something go wrong during the barcode scanning process. In this case, the result status is `EnumResultStatus.exception`. + +```dart +String? errorString; +``` diff --git a/programming/flutter/api-reference/barcode-scanner/barcode-scanner-config.md b/programming/flutter/api-reference/barcode-scanner/barcode-scanner-config.md new file mode 100644 index 00000000..6d2bb3ed --- /dev/null +++ b/programming/flutter/api-reference/barcode-scanner/barcode-scanner-config.md @@ -0,0 +1,249 @@ +--- +layout: default-layout +title: BarcodeScannerConfig Class - Dynamsoft Barcode Reader Flutter Edition +description: BarcodeScannerConfig of DynamsoftBarcodeReader Flutter is the class that defines the configurations for Barcode scanning. +keywords: Barcode, scanner, config, flutter +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: BarcodeScannerConfig +--- + +# BarcodeScannerConfig Class + +`BarcodeScannerConfig` is the class that defines the configurations for the Barcode Scanner. Please see the [code snippet](#code-snippet) section for the full usage of this class. + +## Definition + +*Assembly:* dynamsoft_barcode_reader_bundle_flutter + +```dart +class BarcodeScannerConfig +``` + +## Properties + +| Property | Type | Description | +| -------- | ---- | ----------- | +| [`license`](#license) | *string* | Represents the Barcode Reader license string. | +| [`templateFile`](#templatefile) | *string* | Specifies the template configuration with a file path or a JSON string. | +| [`isTorchButtonVisible`](#istorchbuttonvisible) | *bool* | Determines the visibility status of the torch (flashlight) button of the UI. | +| [`isBeepEnabled`](#isbeepenabled) | *bool* | Establishes whether a beep sound is played when a barcode is successfully detected. | +| [`isVibrateEnabled`](#isvibrateenabled) | *bool* | Determines if the phone will vibrate once a barcode is successfully detected. | +| [`isCloseButtonVisible`](#isclosebuttonvisible) | *bool* | Toggles the visibility of the close button. | +| [`isGuideFrameVisible`](#isguideframevisible) | *bool* | Indicates the visibility status of the guide frame on the display. | +| [`isCameraToggleButtonVisible`](#iscameratogglebuttonvisible) | *bool* | Determines the visibility status of the camera toggle button that is used to switch between the rear and front cameras. | +| [`scanRegion`](#scanregion) | *DMRect?* | Specifies the region that the scanner will focus on and decode barcodes from. | +| [`isScanLaserVisible`](#isscanlaservisible) | *bool* | Enables/Disables the visibility status of the scan laser. | +| [`isAutoZoomEnabled`](#isautozoomenabled) | *bool* | Enables/Disables the auto zoom feature of the camera. | +| [`barcodeFormats`](#barcodeformats) | *EnumBarcodeFormat* | Defines the barcode format(s) that the BarcodeScanner instance will be able to read. | +| [`scanningMode`](#scanningmode) | *EnumScanningMode* | Determines whether the Barcode Scanner will be operating in single-scan or multiple-scan mode. | +| [`maxConsecutiveStableFramesToExit`](#maxconsecutivestableframestoexit) | *int* | Specifies the maximum number of consecutive stable frames to process before finishing the scan process. | +| [`expectedBarcodesCount`](#expectedbarcodescount) | *int* | Defines the expected number of barcodes to be scanned in a single frame or image. | + +> [!NOTE] +> Please note that all of the properties above are Getter/Setter pairs. + +### license + +Represents the Barcode Reader license string. + +```dart +String license; +``` + +### templateFile + +Specifies the template configuration with a file path or a JSON string that defines the various Barcode Reader parameters. Please see this [page](https://www.dynamsoft.com/barcode-reader/docs/core/programming/features/use-runtimesettings-or-templates.html?lang=objc,swift#json-template) for more info on how to create your own template. + +```dart +String? templateFile; +``` + +### isTorchButtonVisible + +Determines the visibility status of the torch (flashlight) button of the UI. If set to `true`, the torch button will be displayed - enabling users to turn the flashlight on/off. Default is `true`. + +```dart +bool isTorchButtonVisible; +``` + +### isBeepEnabled + +Establishes whether a beep sound is played when a barcode is successfully detected. If set to `true`, a beep will be played once a barcode is successfully detected. Default is `false`. + +```dart +bool isBeepEnabled; +``` + +### isVibrateEnabled + +Determines if the phone will provide haptic feedback once a barcode is successfully detected. If set to `true`, the phone will give off a small vibration to indicate that a barcode was successfully recognized. Default is `false`. + +```dart +bool isVibrateEnabled; +``` + +### isCloseButtonVisible + +Toggles the visibility of the close button. If set to `true`, a close button will appear on the top-right corner of the UI to allow the user to close the camera view. If the scanner is closed before a scan is finished, the `status` of the [`BarcodeScanResult`](barcode-scan-result.md) will be `EnumResultStatus.canceled`. Default is `true`. + +```dart +bool isCloseButtonVisible; +``` + +### isCameraToggleButtonVisible + +Determines the visibility status of the camera toggle button that is used to switch between the rear and front cameras. If set to `true`, a button will show up on the bottom-right to allow the user to switch to the front camera (since the default is the rear camera). Default is `false`. + +```dart +bool isCameraToggleButtonVisible; +``` + +### scanRegion + +Specifies the region (as a `DSRect`) that the scanner will focus on and decode barcodes from. The default scan region is the full area of the image/frame. + +```dart +DSRect? scanRegion; +``` +#### Remarks + +`DSRect` is represented with a `top`, `left`, `right`, and `bottom`. The axes that are used to find these borders start from the top-left most point of the image/frame, with the x-axis going left to right and the y-axis going top to bottom. `measuredInPercentage` is the last parameter of `DSRect` - and it determines if the dimensions should be represented as percentages of the frame or not. We recommend to set this to `true` to simplify the process. + +- `top` represents the distance between the x-axis and the top-most point of the Rect. +- `bottom` represents the distance between the x-axis and the bottom-most point of the Rect. +- `left` represents the distance between the y-axis the left-most point of the Rect. +- `right` represents the distance between the y-axis and the right-most point of the Rect. + +```dart +final scanRegion = DSRect(left: 0.1, top: 0.4, right: 0.9, bottom: 0.6, measuredInPercentage: true); +``` + +> [!NOTE] +> Starting with the horizontal part of the scan region - the one above sets the left border of the region 10% away from the y-axis and the right border 90% away from the y-axis. And for the vertical part of the scan region - this one sets the top border 40% away from the x-axis and the bottom border 60% away from the x-axis. + +### isScanLaserVisible + +Enables/Disables the visibility status of the scan laser. The scan laser is just a visual light bar that moves up and down to indicate that the scan process is taking place - it does not affect the performance in any way. Default is `true`. + +```dart +bool IsScanLaserVisible; +``` + +### isAutoZoomEnabled + +Enables/Disables the auto zoom feature of the camera. When enabled (true), the scanner will automatically zoom in when attempting to scan a barcode that it can vaguely localize, but not fully. Zooming in allows the library to more accurately detect the barcode. This is especially helpful in scenarios where there is some distance between the barcode and the camera. Default is `false`. + +```dart +bool IsAutoZoomEnabled; +``` + +### barcodeFormats + +Defines the barcode format(s) (represented as [`EnumBarcodeFormat`](../enum/barcode-format.md)) that the BarcodeScanner instance will be able to read. + +```dart +EnumBarcodeFormat barcodeFormats; +``` + +#### Remarks + +In order to set multiple barcode formats, please use the `|` (OR) operator as such `barcodeFormats: EnumBarcodeFormat.BF_QR_CODE | EnumBarcodeFormat.BF_ONED,` + +### scanningMode + +Determines whether the Barcode Scanner will be operating in single-scan or multiple-scan mode (represented as a [`EnumScanningMode`](../enum/scanning-mode.md)). `EnumScanningMode.single` means that the scanner can recognize only one barcode at a time. `EnumScanningMode.multiple` allows for continuous scanning and for the scanner to recognize multiple barcodes in a single frame. Default value is `EnumScanningMode.single`. + +```dart +EnumScanningMode scanningMode; +``` + +### maxConsecutiveStableFramesToExit + +Specifies the maximum number of consecutive stable frames to process before finishing the scan process. A *stable frame* is one where no new barcode is detected. Default value is 10. + +```dart +int maxConsecutiveStableFramesToExit; +``` + +### expectedBarcodesCount + +Defines the expected number of barcodes to be scanned in a single frame or image. Default value is 999. + +```dart +int expectedBarcodesCount; +``` + +#### Remarks + +- 0: detects at least one barcode. +- N ( N > 0 ): detects N barcodes. +- Dynamsoft Barcode Reader works as a loop trying different parameters to detect as many barcodes as possible till it reaches the nuumber specified by expectedBarcodesCount. If expectedBarcodesCount is 0, the loop stops after a cycle finishes and detects at least one barcode. If ExpectedBarcodesCount is N, the loop stops once N barcodes are detected. + +## How to use BarcodeScannerConfig + +```dart +const config = BarcodeScannerConfig( + + ///The license key required to initialize the BarcodeScanner. + license: "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", //The license string here grants a time-limited free trial which requires network connection to work. + + ///Sets the barcode format(s) to read. + ///This value is a combination of EnumBarcodeFormat flags that determine which barcode types to read. + ///For example, to scan QR codes and OneD codes, + ///set the value to `EnumBarcodeFormat.qrCode | EnumBarcodeFormat.oned`. + barcodeFormats: EnumBarcodeFormat.qrCode | EnumBarcodeFormat.oned, + + ///Defines the scanning area as a DSRect object where barcodes will be detected. + ///Only the barcodes located within this defined region will be processed. + ///Default is undefined, which means the full screen will be scanned. + scanRegion: DSRect(top: 0.25, bottom: 0.75, left: 0.25, right: 0.75, measuredInPercentage: true), // scan the middle 50% of the screen + + ///Determines whether the torch (flashlight) button is visible in the scanning UI. + ///Set to true to display the torch button, enabling users to turn the flashlight on/off. Default is true. + isTorchButtonVisible: true, + + ///Specifies if a beep sound should be played when a barcode is successfully detected. + ///Set to true to enable the beep sound, or false to disable it. Default is false. + isBeepEnabled: false, + + ///Determines if the phone will provide haptic feedback once a barcode is successfully detected. + ///Set to true to make the phone vibrate once a barcode is found. Default is false. + isVibrateEnabled: true, + + ///Enables or disables the auto-zoom feature during scanning. + ///When enabled (true), the scanner will automatically zoom in to improve barcode detection. Default is false. + isAutoZoomEnabled: false, + + ///Determines whether the close button is visible on the scanner UI. + ///This button allows users to exit the scanning interface. Default is true. + isCloseButtonVisible: true, + + ///Specifies whether the camera toggle button is displayed. + ///This button lets users switch between available cameras (e.g., front and rear). Default is false. + isCameraToggleButtonVisible: false, + + ///Determines if a scanning laser overlay is shown on the scanning screen. + ///This visual aid (scan laser) helps indicate the scanning line during barcode detection. Default is true. + isScanLaserVisible: true, + + ///Sets the scanning mode for the BarcodeScanner. + ///The mode is defined by the EnumScanningMode and affects the scanning behavior. Default is `EnumScanningMode.single`. + scanningMode: EnumScanningMode.single, + + ///Defines the expected number of barcodes to be scanned. + ///The scanning process will automatically stop when the number of detected barcodes reaches this count. + ///Only available when `scanningMode` is set to `EnumScanningMode.multiple`. Default is 999. + expectedBarcodesCount: 999, + + ///Specifies the maximum number of consecutive stable frames to process before exiting scanning. + ///A "stable frame" is one where no new barcode is detected. + ///Only available when `scanningMode` is set to `EnumScanningMode.multiple`. Default is 10. + maxConsecutiveStableFramesToExit: 10, + + ///Specifies the template configuration for the BarcodeScanner. + ///This can be either a file path or a JSON string that defines various scanning parameters. + ///Default is undefined, which means the default template will be used. + templateFile: "JSON template string", +); +``` \ No newline at end of file diff --git a/programming/flutter/api-reference/barcode-scanner/barcode-scanner.md b/programming/flutter/api-reference/barcode-scanner/barcode-scanner.md new file mode 100644 index 00000000..f783ca22 --- /dev/null +++ b/programming/flutter/api-reference/barcode-scanner/barcode-scanner.md @@ -0,0 +1,61 @@ +--- +layout: default-layout +title: BarcodeScanner Class - Dynamsoft Barcode Reader Flutter Edition +description: BarcodeScanner of DynamsoftBarcodeScanner Flutter is an activity class that implements barcode scanning features. +keywords: Barcode, scanner, activity +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: BarcodeScanner +--- + +# BarcodeScanner Class + +`BarcodeScanner` is the main class of the Ready-to-Use edition of the library and contains the API needed to implement the barcode scanning functionality. + +## Definition + +*Assembly:* dynamsoft_barcode_reader_bundle_flutter + +```dart +class BarcodeScanner +``` + +## Constructor + +```dart +BarcodeScanner.new() +``` + +## Methods + +### launch + +This function initiates the barcode scanning process by launching a new page (Activity on Android/ViewController on iOS) that displays the camera stream and any other associated UI elements that help with the scanning process. The launch method accepts an optional [`BarcodeScannerConfig`](insert link here) configuration object that allows the developer to customize the scanner's behaviour and UI. + +```dart +Future launch( BarcodeScannerConfig config ) +``` + +#### Returns + +A `Future` that resolves with the [`BarcodeScanResult`](insert link here) when the scanner is closed. + +#### Remarks + +Please note that the launch method needs a valid Barcode Reader license in order to operate. You can request a 30-day trial license via the [Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=guide&package=mobile) portal. + +#### Code Snippet + +```dart +import 'package:dynamsoft_barcode_reader_bundle_flutter/dynamsoft_barcode_reader_bundle_flutter.dart'; + +void _launchBarcodeScanner() async{ + var config = BarcodeScannerConfig( + license: 'YOUR_LICENSE_KEY_HERE', + ); + const result = await BarcodeScanner.launch(config); + if(result.status == EnumResultStatus.finished){ + // handle the result + } +} +``` diff --git a/programming/flutter/api-reference/capture-vision-router-lite/camera-enhancer.md b/programming/flutter/api-reference/capture-vision-router-lite/camera-enhancer.md new file mode 100644 index 00000000..91a33c7f --- /dev/null +++ b/programming/flutter/api-reference/capture-vision-router-lite/camera-enhancer.md @@ -0,0 +1,79 @@ +--- +layout: default-layout +title: CameraEnhancer Class - Dynamsoft Capture Vision Router Lite Flutter +description: CameraEnhancer class of DCV Flutter edition manages camera operations and enhancements. +keywords: camera, enhancer, barcode reader, flutter, capture vision +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# CameraEnhancer + +The `CameraEnhancer` class provides camera-specific functionality including camera selection, focus control, zoom, and other enhanced features. The `CameraEnhancer` is also responsible for the basic UI of the camera view. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +class CameraEnhancer +``` + +## Methods + +### open + +Opens the selected camera to begin the capture process. + +```dart +Future open() +``` + +### setScanRegion + +Sets the scan region of the camera and displays a bordered area on the UI to represent the scan region. + +```dart +Future setScanRegion( DSRect region ) +``` + +### setZoomFactor + +Sets the zoom factor of the camera. + +```dart +Future setZoomFactor( double zoom ) +``` + +### turnOnTorch + +Turns on the camera's flashlight (if available). + +```dart +Future turnOnTorch() +``` + +### turnOffTorch + +Turns off the camera's flashlight (if available). + +```dart +Future turnOffTorch() +``` + +### 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. + +```dart +Future close() +``` + +### destroy + +Destroys the camera enhancer instance and releases the related resources on the host side. + +```dart +Future destroy() +``` diff --git a/programming/flutter/api-reference/capture-vision-router-lite/capture-vision-router.md b/programming/flutter/api-reference/capture-vision-router-lite/capture-vision-router.md new file mode 100644 index 00000000..8002e458 --- /dev/null +++ b/programming/flutter/api-reference/capture-vision-router-lite/capture-vision-router.md @@ -0,0 +1,81 @@ +--- +layout: default-layout +title: CaptureVisionRouter - Dynamsoft Capture Vision Router Lite Flutter +description: CaptureVisionRouter class of Dynamsoft Capture Vision Router contains all of the core methods to use Dynamsoft Capture Vision. +keywords: CaptureVisionRouter, Barcode Reader, capture, flutter, foundational +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +breadcrumbText: CaptureVisionRouter +--- + +# CaptureVisionRouter Class + +The `CaptureVisionRouter` class defines how a user interacts with image-processing and semantic-processing Dynamsoft products in their applications. + +A `CaptureVisionRouter` instance accepts and processes images from an image source and returns processing results which may contain final results or intermediate results. The instance can also process video frames coming from a camera or a different image source as well, therefore providing the ability to capture results via an interactive video scenario or from static images. + + + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +class CaptureVisionRouter +``` + +## Methods + +### capture + +Captures an image using the specified template and processes it - outputting a [`CapturedResult`](captured-result.md) containing the result(s) if there was no exception or error thrown. This method is to be used specifically when working with *static images*. + +```dart +Future capture( ImageData imageData, String templateName ) +``` + +#### 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. + +### startCapturing + +Starts the capturing process using the specified template. Any result(s) (of type [`CapturedResult`](captured-result.md)) that are received while the capture process is underway will be relayed by a result receiver, which is a callback function that is triggered once a captured result is found. + +```dart +Future startCapturing( String templateName ) +``` + +#### 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. + +### stopCapturing + +Stops the capturing process and closes the camera. + +```dart +Future stopCapturing() +``` + +### initSettings + +Initializes the settings of the `CaptureVisionRouter` instance using a JSON template (as a JSON string). To learn how to use a customized JSON template, please refer to this [section of the Foundational User Guide](../../foundational-user-guide.md#using-a-json-template). + +```dart +Future initSettings( String content ) +``` + +### updateSettings + +Updates the specified template settings of the `CaptureVisionRouter` instance using a [`SimplifiedCaptureVisionSettings`](simplified-capture-vision-settings.md) object. To learn how to update the settings using the SimplifiedCaptureVisionSettings class - please refer to this [section of the Foundational User Guide](../../foundational-user-guide.md#using-simplifiedcapturevisionsettings). + +```dart +Future updateSettings( String templateName, SimplifiedCaptureVisionSettings settings ) +``` + +**Remarks** + +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). + diff --git a/programming/flutter/api-reference/capture-vision-router-lite/captured-result-receiver.md b/programming/flutter/api-reference/capture-vision-router-lite/captured-result-receiver.md new file mode 100644 index 00000000..3e359082 --- /dev/null +++ b/programming/flutter/api-reference/capture-vision-router-lite/captured-result-receiver.md @@ -0,0 +1,52 @@ +--- +layout: default-layout +title: CapturedResultReceiver Interface - Dynamsoft Capture Vision Router Lite Flutter +description: CapturedResultReceiver interface of DCV Flutter edition is designed as a standardized way for retrieving captured results. +keywords: decoded barcodes, parsed results, captured results, CRR, result receiver, output, flutter, barcode reader +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# CapturedResultReceiver + +The `CapturedResultReceiver` interface is designed as a standardized way for retrieving captured results in the Dynamsoft Capture Vision architecture. By implementing the `CapturedResultReceiver`, you will receive the callback of the various types of *captured results*, such a decoded barcode (Barcode Reader), a recognized text line (Label Recognizer), a detected quad (Document Normalizer), a normalized image (Document Normalizer), or parsed data (Code Parser). The `CapturedResultReceiver` can add a receiver for any type of captured result or for a specific type of captured result, based on the method that is implemented. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +class CapturedResultReceiver +``` + +## Methods + +| Method | Description | +| ------ | ----------- | +| [`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. | + +### OnCapturedResultReceived + +This callback method delivers a [`CapturedResult`](captured-result.md) - an object representing any kind of captured result item that is captured 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 Function(CapturedResult result)? onCapturedResultReceived; +``` + +**Parameters** + +`result`: The captured result, an instance of [`CapturedResult`](captured-result.md). + +### OnDecodedBarcodesReceived + +This callback method delivers a [`DecodedBarcodesResult`](decoded-barcodes-result.md), which is an object representing any captured result of type `CRIT_BARCODE` 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 Function(DecodedBarcodesResult result)? onDecodedBarcodesReceived; +``` + +**Parameters** + +`result`: The decoded barcode result, an instance of [`DecodedBarcodesResult`](decoded-barcodes-result.md). diff --git a/programming/flutter/api-reference/capture-vision-router-lite/captured-result.md b/programming/flutter/api-reference/capture-vision-router-lite/captured-result.md new file mode 100644 index 00000000..73785495 --- /dev/null +++ b/programming/flutter/api-reference/capture-vision-router-lite/captured-result.md @@ -0,0 +1,74 @@ +--- +layout: default-layout +title: CapturedResult Class - Dynamsoft Capture Vision Router Lite Flutter +description: CapturedResult class of DCV Flutter edition represents the result of a capture operation on an image. +keywords: decoded barcode, parsed result, error code, output, captured result, flutter, barcode reader +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# CapturedResult + +The `CapturedResult` class represents the result of a capture operation on an image. Internally, `CapturedResult` stores an array of `CapturedResultItem`, each of which may be a barcode, text line, detected quad, normalized image, original image, or parsed item depending on the functional product that is used. + +> [!TIP] +> In the context of the Barcode Reader, you will most likely be using the [DecodedBarcodesResult]({{ site.dbr_maui_api }}decoded-barcodes-result.html) as the main result type. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +class CapturedResult +``` + +## Properties + +| Property | Type | Description | +| --------- | ----------- | +| [`originalImageHashId`](#originalimagehashid) | *String* | The hash id of the original image. You can use this ID to get the original image via the `IntermediateResultManager` class. | +| [`rotationTransformMatrix`](#rotationtransformmatrix) | *Matrix4* | The rotation transformation matrix of the original image relative to the rotated image. | +| [`errorCode`](#errorcode) | *int* | The error code associated with the capture result. | +| [`errorMessage`](#errormessage) | *String* | The error message associated with the capture result. | +| [`decodedBarcodesResult`](#decodedbarcodesresult) | [*DecodedBarcodesResult*](decoded-barcodes-result.md) | A [`DecodedBarcodesResult`](decoded-barcodes-result.md) object that represents all of the decoded barcode(s) within the original image. | + +### originalImageHashId + +Returns the hash ID of the original image that contains the captured result. You can use this ID to get the original image via the `IntermediateResultManager` class. + +```dart +String originalImageHashId, +``` + +### rotationTransformMatrix + +The rotation transformation matrix (represented as a [`Matrix4`(https://api.flutter.dev/flutter/package-vector_math_vector_math_64/Matrix4-class.html)]) of the original image relative to the rotated image. + +```dart +Matrix4 rotationTransformMatrix; +``` + +### errorCode + +The error code produced by the library and associated with the captured result should something go wrong during the recognition process. + +```dart +int errorCode; +``` + +### errorMessage + +The error string associated with the error code, providing details about the error. + +```dart +String errorMessage; +``` + +### decodedBarcodesResult + +A [`DecodedBarcodesResult`](decoded-barcodes-result.md) object that represents all of the decoded barcode(s) within the original image. + +```dart +DecodedBarcodesResult? decodedBarcodesResult; +``` diff --git a/programming/flutter/api-reference/capture-vision-router-lite/decoded-barcodes-result.md b/programming/flutter/api-reference/capture-vision-router-lite/decoded-barcodes-result.md new file mode 100644 index 00000000..d9f9f821 --- /dev/null +++ b/programming/flutter/api-reference/capture-vision-router-lite/decoded-barcodes-result.md @@ -0,0 +1,44 @@ +--- +layout: default-layout +title: DecodedBarcodesResult Class - Dynamsoft Barcode Reader Flutter Edition +description: The DecodedBarcodesResult class represents the result of a barcode reading process. It provides access to information about the decoded barcodes, the source image, and any errors that occurred during the barcode reading process. +keywords: GetOriginalImageHashId, GetItemsCount, GetErrorCode, DecodedBarcodesResult, api reference, barcode result, capture, flutter +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: DecodedBarcodesResult +--- + +# DecodedBarcodesResult Class + +The `DecodedBarcodesResult` class represents the result of a barcode reading process. It provides access to information about the decoded barcodes, the source image, and any errors that occurred during the barcode reading process. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +class DecodedBarcodesResult +``` + +## Properties + +| Property | Type | Description | +| -------- | ---- | ----------- | +| [`items`](#items) | *List?* | A list of [`BarcodeResultItem`](barcode-result-item.md), the basic unit representing a single barcode result. | + +The following properties are inherited from [`CapturedResult`](./capture-vision-router-lite/captured-result.md): + +| Property | Type | Description | +| -------- | ---- | ----------- | +| [`originalImageHashId`](#originalimagehashid) | *String* | The hash id of the original image. You can use this ID to get the original image via the `IntermediateResultManager` class. | +| [`rotationTransformMatrix`](#rotationtransformmatrix) | *Matrix4* | The rotation transformation matrix of the original image relative to the rotated image. | +| [`errorCode`](#errorcode) | *int* | The error code associated with the capture result. | +| [`errorMessage`](#errormessage) | *String* | The error message associated with the capture result. | + +### items + +A list of [`BarcodeResultItem`](barcode-result-item.md), the basic unit representing a single barcode result and its associated info. + +```dart +List? items; +``` diff --git a/programming/flutter/api-reference/capture-vision-router-lite/license-manager.md b/programming/flutter/api-reference/capture-vision-router-lite/license-manager.md new file mode 100644 index 00000000..09984d8c --- /dev/null +++ b/programming/flutter/api-reference/capture-vision-router-lite/license-manager.md @@ -0,0 +1,42 @@ +--- +layout: default-layout +title: LicenseManager Class - Dynamsoft Capture Vision Router Lite Flutter +description: LicenseManager class of DCV Flutter provides API to initialize and verify product licenses. +keywords: license, manager, barcode reader, flutter, capture vision +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# LicenseManager + +The `LicenseManager` class provides the API needed to initialize and verify the licenses for the functional products that are being used by the `CaptureVisionRouter` instance. For example, if the `CaptureVisionRouter` instance is using the Barcode Reader, then the `LicenseManager` must include a valid Barcode Reader license. If it is using both the Barcode Reader and the Code Parser, then the `LicenseManager` must include a license for each product. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +class LicenseManager +``` + +## Methods + +### initLicense + +Initializes the license for the application using the provided license key. A single **license key** can contain a license for a single product or licenses for multiple products - depending on the functional product(s) that the CaptureVisionRouter will utilize. + +```dart +Future<(bool, String?)> initLicense( String license ) +``` + +**Code Snippet** + +```dart +final result = await LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); +if (result.isSuccess) { + print("License initialized successfully"); +} else { + print("License initialization failed: ${result.message}"); +} +``` \ No newline at end of file diff --git a/programming/flutter/api-reference/capture-vision-router-lite/simplified-barcode-reader-settings.md b/programming/flutter/api-reference/capture-vision-router-lite/simplified-barcode-reader-settings.md new file mode 100644 index 00000000..f0b6d7af --- /dev/null +++ b/programming/flutter/api-reference/capture-vision-router-lite/simplified-barcode-reader-settings.md @@ -0,0 +1,153 @@ +--- +layout: default-layout +title: SimplifiedBarcodeReaderSettings Class - Dynamsoft Barcode Reader Flutter Edition +description: SimplifiedBarcodeReaderSettings class contains settings for barcode decoding. It is a sub-parameter of SimplifiedCaptureVisionSettings +keywords: SimplifiedBarcodeReaderSettings, SimplifiedCaptureVisionSettings, inverted barcode, Deblur, localization, expected barcodes count, barcode format, confidence, RegEx pattern, flutter +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: SimplifiedBarcodeReaderSettings +--- + +# SimplifiedBarcodeReaderSettings + +The `SimplifiedBarcodeReaderSettings` class comes from the [`SimplifiedCaptureVisionSettings`](./capture-vision-router-lite/simplified-capture-vision-settings.md) class and contains a limited subset of the parameters that influence the Barcode Reader's performance. If you would like to get familiar with the full parameters available to the Barcode Reader, please visit the [main parameters page]({{ site.dcvb_parameters }}file/index.html?product=dbr&lang=objectivec-swift). + +> [!TIP] +> If you visit the main parameters page, the majority of the settings related to the Barcode Reader will be in `BarcodeReaderTaskSetting`, `ImageParameter`, and `BarcodeFormatSpecification`. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +class SimplifiedBarcodeReaderSettings +``` + +## Properties + +| Property | Type | Description | +|----------|------|-------------| +| [`barcodeFormatIds`](#barcodeformatids) | [*EnumBarcodeFormat*](./enum/barcode-format.md) | Specifies which barcode format(s) the Barcode Reader will target. | +| [`expectedBarcodesCount`](#expectedbarcodescount) | *int* | Determines the expected barcode count, which can be set to 0 if the barcode count is unknown. | +| [`localizationModes`](#localizationmodes) | *List* | Defines which localization modes (as [`EnumLocalizationMode`](./enum/localization-mode.md)) the barcode reader will use during the detection process. | +| [`deblurModes`](#deblurmodes) | *List* | Sets which deblur algorithms (as [`EnumDeblurMode`](./enum/deblur-mode.md)) the library will apply during the detection process when dealing with blurry images/frames. | +| [`minResultConfidence`](#minresultconfidence) | *int* | Specifies the minimum barcode result confidence to help filter out inaccurate results. | +| [`minBarcodeTextLength`](#minbarcodetextlength) | *int* | Sets the minimum barcode text length (in characters) for the barcode result to be considered valid. | +| [`barcodeTextRegExPattern`](#barcodetextregexpattern) | *String* | Defines a regular expression pattern that the barcode text must match to be considered valid. | +| [`maxThreadsInOneTask`](#maxthreadsinonetask) | *int* | Establishes the maximum number of threads available for a single detection task. | +| [`grayscaleTransformationModes`](#grayscaletransformationmodes) | *List* | Determines which grayscale transformation modes (as [`EnumGrayscaleTransformationMode`](./enum/grayscale-transformation-mode.md)) the barcode reader will apply before the detection process. | +| [`grayscaleEnhancementModes`](#grayscaleenhancementmodes) | *List* | Sets which grayscale enhancement modes (as [`EnumGrayscaleEnhancementModes`](./enum/grayscale-enhancement-mode.md)) the library will apply before the detection process. | +| [`scaleDownThreshold`](#scaledownthreshold) | *int* | Defines the threshold for scaling down the image/frame before processing to help with memory overhead. | + +### barcodeFormatIds + +Specifies which barcode format(s) (as [EnumBarcodeFormat](./enum/barcode-format.md)) the Barcode Reader will target. To learn more on how to set the barcode formats, please refer to the [Foundational Guide](../foundational-user-guide.md#specify-barcode-formats-and-count). + +```dart +EnumBarcodeFormat barcodeFormatIds; +``` + +### expectedBarcodesCount + +Determines the expected barcode count, which can be set to 0 if the barcode count is unknown. + +```dart +int expectedBarcodesCount; +``` + +**Remarks** + +- 0: detects at least one barcode. +- N ( N > 0 ): detects N barcodes. +- Dynamsoft Barcode Reader works in a loop trying different parameters to reach the number of expected barcodes specified by this parameter. If ExpectedBarcodesCount is 0, the loop stops after at least one barcode is found in an iteration. If ExpectedBarcodesCount is N, the loop stops once N barcodes are detected. + +### localizationModes + +Defines which localization modes (as a list of [`EnumLocalizationMode`](./enum/localization-mode.md)) the barcode reader will use during the detection process. Each [`EnumLocalizationMode`](./enum/localization-mode.md)) represents a different localization method, some of which are more optimized for certain barcode formats over others. + +```dart +List localizationModes; +``` + +**Remarks** + +Certain localization modes are specially optimized for certain barcode formats. For example, `lines` is designed primarily for 1D and PDF417 barcodes, while `statisticsMarks` is optimized for DPM codes. If you want to further improve the read rate of certain barcode types, please go through [EnumLocalizationMode](enum/localization-mode.md) page to learn which modes to apply based on the targeted barcode format(s). + +### deblurModes + +Sets which deblur algorithms (as [`EnumDeblurMode`](./enum/deblur-mode.md)) the library will apply during the detection process when dealing with blurry images/frames. + +```dart +List deblurModes; +``` + +### minResultConfidence + +Specifies the minimum barcode result confidence to help filter out inaccurate results. Confidence is a measure of a barcode result's accuracy, so by setting this parameter to a higher value, you ensure that the library will relay only the more accurate results. + +```dart +int minResultConfidence; +``` + +**Remarks** + +The default `minresultConfidence` value is 30, which is a sufficient level of accuracy for most scenarios. + +### minBarcodeTextLength + +Sets the minimum barcode text length (in characters) for the barcode result to be considered valid. Any results that do not meet this text length will be discarded by the library. + +```dart +int minBarcodeTextLength; +``` + +### barcodeTextRegExPattern + +Defines a regular expression pattern that the barcode text must match to be considered valid. Any barcode results that do not follow this RegEx pattern will be discarded by the library. + +```dart +String barcodeTextRegExPattern; +``` + +### maxThreadsInOneTask + +Establishes the maximum number of threads available for a single detection task. + +```dart +int maxThreadsInOneTask; +``` + +### grayscaleTransformationModes + +Determines which grayscale transformation modes (as [`EnumGrayscaleTransformationMode`](./enum/grayscale-transformation-mode.md)) the barcode reader will apply before the detection process. *This parameter controls the library's ability to read inverted barcodes.* + +```dart +List grayscaleTransformationModes; +``` + +**Remarks** + +- [ GTM_ORIGINAL ]: Process original coloured barcodes only. +- [ GTM_INVERTED ]: Process inverted coloured barcodes only. +- [ GTM_ORIGINAL, GTM_INVERTED ]: Process both original and inverted coloured barcodes. The library will search for the original coloured barcodes first. +- [ GTM_INVERTED, GTM_ORIGINAL ]: Process both original and inverted coloured barcodes. The library will search for the inverted coloured barcodes first. + +### grayscaleEnhancementModes + +Sets which grayscale enhancement modes (as [`EnumGrayscaleEnhancementModes`](./enum/grayscale-enhancement-mode.md)) the library will apply before the detection process. + +```dart +List grayscaleEnhancementModes; +``` + +Remarks + + + +### scaleDownThreshold + +Defines the threshold for scaling down the image/frame before processing to help with memory overhead. If both the width and height are larger than the threshold, the image is shrinked by half. + +```dart +int scaleDownThreshold; +``` diff --git a/programming/flutter/api-reference/capture-vision-router-lite/simplified-capture-vision-settings.md b/programming/flutter/api-reference/capture-vision-router-lite/simplified-capture-vision-settings.md new file mode 100644 index 00000000..74169318 --- /dev/null +++ b/programming/flutter/api-reference/capture-vision-router-lite/simplified-capture-vision-settings.md @@ -0,0 +1,97 @@ +--- +layout: default-layout +title: SimplifiedCaptureVisionSettings Class - Dynamsoft Capture Vision Router Lite Flutter +description: SimplifiedCaptureVisionSettings class of DCV Flutter edition provides settings for capturing and recognizing images with the CaptureVisionRouter class. +keywords: roi, result item type, min interval, timeout, flutter, settings, foundational +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# SimplifiedCaptureVisionSettings + +The `SimplifiedCaptureVisionSettings` class contains the general settings for all of the Capture Vision functional products (Barcode Reader, Label Recognizer, Document Normalizer, Code Parser). These settings can help for capturing and recognizing images with the `CaptureVisionRouter` class. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +class SimplifiedCaptureVisionSettings +``` + +## Properties + +| Property | Type | Description | +| ---------- | ---- | ----------- | +| [`capturedResultItemTypes`](#capturedresultitemtypes) | [*EnumCapturedResultItemType*](../enum/captured-result-item-type.md) | Specifies the type(s) of [`CapturedResult`](captured-result.md) that the library will output. | +| [`roi`](#roi) | *Quadrilateral* | Sets the region of interest (ROI) when reading from a camera or a static image. | +| [`roiMeasuredInPercentage`](#roimeasuredinpercentage) | *bool* | Establishes whether the ROI is measured in pixels or as a percentage of the image/frame size. | +| [`maxParallelTasks`](#maxparalleltasks) | *int* | Determines the maximum number of parallel tasks allowed for image capture and recognition. | +| [`minImageCaptureInterval`](#minimagecaptureinterval) | *int* | Sets the minimum interval (in milliseconds) between image captures. | +| [`timeout`](#timeout) | *int* | Specifies the maximum time (in milliseconds) allowed for image capture and recognition. | +| [`barcodeSettings`](#barcodesettings) | *[SimplifiedBarcodeReaderSettings](simplified-barcode-reader-settings.md)* | The settings for the `DynamsoftBarcodeReader` tasks. | + +### capturedResultItemTypes + +Specifies the type(s) of [`CapturedResult`](captured-result.md) that the library will output, represented as [`EnumCapturedResultItemType`](../enum/captured-result-item-type.md). + +```dart +EnumCapturedResultItemType capturedResultItemTypes; +``` + +**Remarks** + +If you are using + +### roi + +Sets the region of interest (ROI) when reading from a camera or a static image. If the camera is being used, any scan region that is set will be represented visually on the camera view. + +```dart +Quadrilateral roi; +``` + +### roiMeasuredInPercentage + +Specifies whether the region of interest (ROI) is measured in pixels or as a percentage of the image size. + +```dart +bool roiMeasuredInPercentage; +``` + +### maxParallelTasks + +Determines the maximum number of parallel tasks allowed for image capture and recognition. + +```dart +int maxParallelTasks; +``` + +### minImageCaptureInterval + +Sets the minimum interval (in milliseconds) between image captures. + +```dart +int minImageCaptureInterval; +``` + +### timeout + +Specifies the maximum time (in milliseconds) allowed for image capture and recognition. + +```dart +int Timeout { get; set; } +``` + +### barcodeSettings + +The settings for the `DynamsoftBarcodeReader` tasks as a [`SimplifiedBarcodeReaderSettings`](simplified-barcode-reader-settings.md) object. + +```dart +SimplifiedBarcodeReaderSettings barcodeSettings; +``` + +**Remarks** + +If you would like to learn more on how to configure the Barcode Reader, please refer to the [User Guide (Foundational Edition)](../../foundational-user-guide.md#configuring-the-barcode-reader-optional). diff --git a/programming/flutter/api-reference/enum/barcode-format.md b/programming/flutter/api-reference/enum/barcode-format.md new file mode 100644 index 00000000..133fc5a7 --- /dev/null +++ b/programming/flutter/api-reference/enum/barcode-format.md @@ -0,0 +1,120 @@ +--- +layout: default-layout +title: EnumBarcodeFormat - Dynamsoft Barcode Reader Flutter +description: Enumeration EnumBarcodeFormat of DBR Flutter Edition defines the supported barcode formats. +keywords: barcode format, Flutter, OneD, QR Code, GS1 Databar +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: EnumBarcodeFormat +--- + +# EnumBarcodeFormat + +`EnumBarcodeFormat` is an enumeration that represents the supported barcode formats of the Barcode Reader. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +enum EnumBarcodeFormat +{ + /** No barcode format specified.*/ + none, + /** Represents all supported barcode formats. Useful for scanning operations where any type of barcode is acceptable. */ + all, + /** Default barcode formats that are commonly used. This is a subset of `all` tailored for general use. */ + defaultFormat, + /** One-dimensional barcode formats, including BF_CODE_39, BF_CODE_128, BF_CODE_93, BF_CODABAR, BF_ITF, BF_EAN_13, BF_EAN_8, BF_UPC_A, BF_UPC_E, INDUSTRIAL_25, BF_CODE_39_Extended and BF_MSI_CODE. */ + oned, + /** Code 39 format, widely used in various industries for inventory and manufacturing. */ + code39, + /** Code 128 format, a high-density barcode for alphanumeric or numeric-only data. */ + code128, + /** Code 93 format, similar to Code 39 but more compact and secure with support for the full ASCII character set. */ + code93, + /** Codabar format, used for various numeric barcodes in libraries, blood banks, and parcels. */ + codabar, + /** Interleaved 2 of 5 format, a numeric-only barcode used in warehousing, distribution, and logistics. */ + itf, + /** EAN-13 format, a superset of the UPC-A barcode used worldwide for marking retail goods. */ + ean13, + /** EAN-8 format, a compressed version of EAN-13 for smaller packages. */ + ean8, + /** UPC-A format, widely used in the United States and Canada for tracking trade items in stores. */ + upcA, + /** UPC-E format, a smaller version of the UPC-A barcode used for smaller packages. */ + upcE, + /** Industrial 2 of 5 format, an older, numeric-only barcode used in the industrial sector. */ + industrial25, + /** Extended Code 39 format, capable of encoding the full ASCII character set by combining standard Code 39 characters. */ + code39Extended, + /** GS1 DataBar barcode formats, including BF_GS1_DATABAR_OMNIDIRECTIONAL, BF_GS1_DATABAR_TRUNCATED, BF_GS1_DATABAR_STACKED, BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL, BF_GS1_DATABAR_EXPANDED, BF_GS1_DATABAR_EXPANDED_STACKED, BF_GS1_DATABAR_LIMITED. These barcodes are designed for use in retail and healthcare for fresh foods and small items. */ + gs1Databar, + gs1DatabarStackedOmnidirectional, + gs1DatabarTruncated, + gs1DatabarStacked, + gs1DatabarOmnidirectional, + gs1DatabarExpanded, + gs1DatabarExpandedStacked, + gs1DatabarLimited, + /** Patch code, a special barcode used for document scanning applications to separate batches of documents. */ + patchcode, + /** Micro PDF417, a compact version of PDF417 used for applications where space is limited. */ + microPdf417, + /** MSI Code, a barcode used in inventory and warehouse to encode information in the distribution of goods. */ + msiCode, + /** Code 11, used primarily for labeling telecommunications equipment. */ + code11, + /** Two-Digit Add-On, an extension to UPC and EAN codes for magazines and books. */ + twoDigitAddOn, + /** Five-Digit Add-On, used with UPC and EAN codes for additional data, such as suggested retail price. */ + fiveDigitAddOn, + /** Code 32, also known as Italian PharmaCode, used specifically in the Italian pharmaceutical industry. */ + code32, + /** PDF417, a two-dimensional barcode used in a variety of applications, capable of encoding large amounts of data. */ + pdf417, + /** QR Code, a widely used two-dimensional barcode with high data capacity and error correction capability. */ + qrCode, + /** DataMatrix, a two-dimensional barcode used for marking small items, providing high data density and reliability. */ + datamatrix, + /** Aztec, a two-dimensional barcode known for its compact size and suitability for encoding small amounts of data efficiently. */ + aztec, + /** MaxiCode, a two-dimensional barcode used primarily for parcel and package tracking in logistics and postal services. */ + maxicode, + /** Micro QR, a smaller version of the QR Code designed for applications where space is limited. */ + microQr, + /** GS1 Composite, a group of barcodes used in conjunction with GS1 DataBar or linear barcodes to provide additional information. */ + gs1Composite, + /** Nonstandard barcode, a placeholder for barcodes that do not conform to established industry standards. */ + nonStandardBarcode, + /** DotCode, a two-dimensional barcode designed for high-speed printing applications. */ + dotcode, + /** PharmaCode, a general category that includes both BF_PHARMACODE_ONE_TRACK and BF_PHARMACODE_TWO_TRACK. */ + pharmacode, + /** PharmaCode One Track, used in the pharmaceutical industry for packaging control. */ + pharmacodeOneTrack, + /** PharmaCode Two Track, an extension of PharmaCode for encoding additional data. */ + pharmacodeTwoTrack, + /** Matrix 2 of 5, an older form of barcode used in warehouse sorting and conveyor systems. */ + matrix25, + /**Combined value of BF2_USPSINTELLIGENTMAIL, BF2_POSTNET, BF2_PLANET, BF2_AUSTRALIANPOST, BF2_RM4SCC, BF_KIX.*/ + postalCode, + /** USPS Intelligent Mail, a barcode used by the United States Postal Service to provide greater information and tracking capabilities. */ + uspsIntelligentMail, + /** Postnet, used by the USPS for automating the sorting of mail. */ + postnet, + /** Planet, another USPS barcode, similar to Postnet, but with additional data capacity. */ + planet, + /** Australian Post, barcodes used by the Australian postal service for mail sorting. */ + australianPost, + /** RM4SCC (Royal Mail 4 State Customer Code), used by the UK's Royal Mail for automated mail sorting. */ + rm4scc, + /** KIX (Klant index - Customer index), used by the Dutch postal service for sorting mail. */ + kix, + /**Telepen*/ + telepen, + /**Telepen Numeric. A variation of the Telepen format optimized for encoding numeric data only.*/ + telepenNumeric +} +``` diff --git a/programming/flutter/api-reference/enum/captured-result-item-type.md b/programming/flutter/api-reference/enum/captured-result-item-type.md new file mode 100644 index 00000000..e183236b --- /dev/null +++ b/programming/flutter/api-reference/enum/captured-result-item-type.md @@ -0,0 +1,50 @@ +--- +layout: default-layout +title: EnumCapturedResultItemType - Dynamsoft Barcode Reader Flutter +description: Enumeration EnumCapturedResultItemType of DBR Flutter Edition defines the accepted result types that the Capture Vision instance will output +keywords: captured result, flutter, capture vision, settings, barcode reader +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: EnumCapturedResultItemType +--- + +# EnumCapturedResultItemType + +`EnumCapturedResultItemType` is an enumeration that specifies the different types of results that a `CaptureVisionRouter` instance can output. Each functional product under the Capture Vision umbrella has its own unique result type(s). For instance, the Barcode Reader outputs the result type `barcode`, while the Document Normalizer outputs a `detectedQuad` or a `deskewedImage`. + +> [!NOTE] +> Although most of the result types are unique to a certain functional product, the `originalImage` result type is shared between all of the functional products. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +enum EnumDeblurMode +{ + /** Skips the process, no deblurring is applied. */ + skip, + /** Applies a direct binarization algorithm for generating the binary image. */ + directBinarization, + /** Utilizes a threshold binarization algorithm for generating the binary image, dynamically determining the threshold based on the image content. */ + thresholdBinarization, + /** Employs a gray equalization algorithm to adjust the contrast and brightness, improving the clarity of the gray-scale image before binarization. */ + grayEqualization, + /** Implements a smoothing algorithm to reduce noise and artifacts, smoothing out the gray-scale image before binarization. */ + smoothing, + /** Uses a morphing algorithm to enhance the gray-scale image before binarization. */ + morphing, + /** Engages in a deep analysis of the grayscale image based on the barcode format to intelligently generate the optimized binary image, tailored to complex or severely blurred images. */ + deepAnalysis, + /** Applies a sharpening algorithm to enhance the edges and details of the barcode, making it more distinguishable on the gray-scale image before binarization. */ + sharpening, + /** Decodes the barcodes based on the binary image obtained during the localization process. */ + basedOnLocBin, + /** Combines sharpening and smoothing algorithms for a comprehensive deblurring effect, targeting both clarity and smoothness of the gray-scale image before binarization. */ + sharpeningSmoothing, + /** Use the deep learning algorithm to recognize the barcodes. */ + neuralNetwork, + /**Placeholder value with no functional meaning. */ + end +} +``` diff --git a/programming/flutter/api-reference/enum/deblur-mode.md b/programming/flutter/api-reference/enum/deblur-mode.md new file mode 100644 index 00000000..131174a0 --- /dev/null +++ b/programming/flutter/api-reference/enum/deblur-mode.md @@ -0,0 +1,47 @@ +--- +layout: default-layout +title: EnumDeblurMode - Dynamsoft Barcode Reader Flutter +description: Enumeration EnumDeblurMode of DBR Flutter Edition defines the modes for extracting barcode data during the final phase of the barcode decoding process +keywords: barcode format, Flutter, OneD, QR Code, GS1 Databar +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: EnumDeblurMode +--- + +# EnumDeblurMode + +`EnumDeblurMode` is an enumeration that specifies the image processing algorithms applied to the localized zones containing barcodes, with the main aim being to generate a binary image for extracting barcode data during the final phase of the barcode decoding process. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +enum EnumDeblurMode +{ + /** Skips the process, no deblurring is applied. */ + skip, + /** Applies a direct binarization algorithm for generating the binary image. */ + directBinarization, + /** Utilizes a threshold binarization algorithm for generating the binary image, dynamically determining the threshold based on the image content. */ + thresholdBinarization, + /** Employs a gray equalization algorithm to adjust the contrast and brightness, improving the clarity of the gray-scale image before binarization. */ + grayEqualization, + /** Implements a smoothing algorithm to reduce noise and artifacts, smoothing out the gray-scale image before binarization. */ + smoothing, + /** Uses a morphing algorithm to enhance the gray-scale image before binarization. */ + morphing, + /** Engages in a deep analysis of the grayscale image based on the barcode format to intelligently generate the optimized binary image, tailored to complex or severely blurred images. */ + deepAnalysis, + /** Applies a sharpening algorithm to enhance the edges and details of the barcode, making it more distinguishable on the gray-scale image before binarization. */ + sharpening, + /** Decodes the barcodes based on the binary image obtained during the localization process. */ + basedOnLocBin, + /** Combines sharpening and smoothing algorithms for a comprehensive deblurring effect, targeting both clarity and smoothness of the gray-scale image before binarization. */ + sharpeningSmoothing, + /** Use the deep learning algorithm to recognize the barcodes. */ + neuralNetwork, + /**Placeholder value with no functional meaning. */ + end +} +``` diff --git a/programming/flutter/api-reference/enum/grayscale-enhancement-mode.md b/programming/flutter/api-reference/enum/grayscale-enhancement-mode.md new file mode 100644 index 00000000..c88cdb3e --- /dev/null +++ b/programming/flutter/api-reference/enum/grayscale-enhancement-mode.md @@ -0,0 +1,37 @@ +--- +layout: default-layout +title: EnumGrayscaleEnhancementMode - Dynamsoft Barcode Reader Flutter +description: Enumeration EnumGrayscaleEnhancementMode of DBR Flutter Edition defines the modes for extracting barcode data during the final phase of the barcode decoding process +keywords: barcode format, Flutter, OneD, QR Code, GS1 Databar, barcode reader, settings, grayscale +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: EnumGrayscaleEnhancementMode +--- + +# EnumGrayscaleEnhancementMode + +`EnumGrayscaleEnhancementMode` is an enumeration that determines which grayscale enhancement modes the library will apply before the detection process to improve the read rate of the barcodes in a given image or frame. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +enum EnumGrayscaleEnhancementMode +{ + /** Disables any grayscale image preprocessing. Selecting this mode skips the preprocessing step, passing the image through to subsequent operations without modification. */ + skip, + /** Automatic selection of grayscale enhancement mode which is currently not supported. Future implementations may automatically choose the most suitable enhancement based on image analysis. */ + auto, + /** Uses the original, unprocessed image for subsequent operations. This mode is selected when no specific grayscale enhancement is required, maintaining the image in its natural state. */ + general, + /** Applies a grayscale equalization algorithm to the image, enhancing contrast and detail in gray level. Suitable for images with poor contrast. */ + grayEqualize, + /** Implements a grayscale smoothing algorithm to reduce noise and smooth the image. This can be beneficial for images with high levels of grain or noise. */ + graySmooth, + /** Enhances the image by applying both sharpening and smoothing algorithms. This mode aims to increase clarity and detail while reducing noise, offering a balanced approach to image preprocessing. */ + sharpenSmooth, + /** Placeholder value with no functional meaning. */ + end +} +``` diff --git a/programming/flutter/api-reference/enum/grayscale-transformation-mode.md b/programming/flutter/api-reference/enum/grayscale-transformation-mode.md new file mode 100644 index 00000000..24516a93 --- /dev/null +++ b/programming/flutter/api-reference/enum/grayscale-transformation-mode.md @@ -0,0 +1,33 @@ +--- +layout: default-layout +title: EnumGrayscaleTransformationMode - Dynamsoft Barcode Reader Flutter +description: Enumeration EnumGrayscaleTransformationMode of DBR Flutter Edition defines the modes for extracting barcode data during the final phase of the barcode decoding process +keywords: barcode reader, settings, grayscale +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: EnumGrayscaleTransformationMode +--- + +# EnumGrayscaleTransformationMode + +`EnumGrayscaleTransformationMode` is an enumeration that determines which grayscale enhancement modes the library will apply before the detection process to improve the read rate of the barcodes in a given image or frame. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +enum EnumGrayscaleEnhancementMode +{ + /** Bypasses grayscale transformation, leaving the image in its current state without any modification to its grayscale values. This mode is selected when no alteration of the grayscale data is desired, passing the image through to subsequent operations without modification. */ + skip, + /** Applies an inversion to the grayscale values of the image, effectively transforming light elements to dark and vice versa. This mode is particularly useful for images with light text on dark backgrounds, enhancing visibility for further processing. */ + inverted, + /** Maintains the original grayscale values of the image without any transformation. This mode is suited for images with dark elements on light backgrounds, ensuring the natural contrast and detail are preserved for subsequent analysis. */ + original, + /** Delegates the choice of grayscale transformation to the library's algorithm, which automatically determines the most suitable transformation based on the image's characteristics. This mode is beneficial when the optimal transformation is not known in advance or varies across different images. */ + auto, + /** Placeholder value with no functional meaning. */ + end +} +``` diff --git a/programming/flutter/api-reference/enum/localization-mode.md b/programming/flutter/api-reference/enum/localization-mode.md new file mode 100644 index 00000000..7b29b1e8 --- /dev/null +++ b/programming/flutter/api-reference/enum/localization-mode.md @@ -0,0 +1,50 @@ +--- +layout: default-layout +title: EnumLocalizationMode - Dynamsoft Barcode Reader Flutter +description: Enumeration EnumLocalizationMode of DBR Flutter Edition specifies the strategies used to identify the locations of barcodes within an image. +keywords: localization, Flutter, settings, performance, barcode reader +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: EnumLocalizationMode +--- + +# EnumLocalizationMode + +`EnumLocalizationMode` is an enumeration that represents the strategies used to identify the location of barcodes within an image or frame. Localization is one of the first and most important steps in the barcode detection process, so choosing the right localization modes for the scenario can make quite the difference in performance. + +> [!NOTE] +> Some localization modes are optimized for certain barcode formats as you can see in the description of each mode below. However, it is recommended to have the `connectedBlocks` mode as the highest priority localization mode for any scenario as it is one most highly adaptable localization algorithms for any kind of scenario. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +enum EnumLocalizationMode +{ + /** Omits the localization process entirely. */ + skip, + /** Automatic localization mode selection; not yet implemented so this is a placeholder until then. */ + auto, + /** Identifies barcodes by finding connected blocks, offering optimal results, especially recommended for highest priority in most scenarios. */ + connectedBlocks, + /** Detects barcodes through analysis of patterns of contiguous black and white regions, tailored for QR Codes and DataMatrix codes. */ + statistics, + /** Locates barcodes by identifying linear patterns, designed primarily for 1D barcodes and PDF417 codes. */ + lines, + /** Provides rapid barcode localization, suited for interactive applications where speed is crucial. */ + scanDirectly, + /** Targets barcode localization through detection of specific mark groups, optimized for Direct Part Marking (DPM) codes. */ + statisticsMarks, + /** Combines methods of locating connected blocks and linear patterns to efficiently localize postal codes. */ + statisticsPostalCode, + /** Initiates barcode localization from the image center, facilitating faster detection in certain layouts. */ + centre, + /** Specialized for quick localization of 1D barcodes, enhancing performance in fast-scan scenarios. */ + oneDFastScan, + /** Localizes barcodes by utilizing a neural network model. */ + neuralNetwork, + /** Placeholder value with no functional meaning. */ + end +} +``` diff --git a/programming/flutter/api-reference/enum/preset-template.md b/programming/flutter/api-reference/enum/preset-template.md new file mode 100644 index 00000000..5c3fac87 --- /dev/null +++ b/programming/flutter/api-reference/enum/preset-template.md @@ -0,0 +1,29 @@ +--- +layout: default-layout +title: EnumPresetTemplate - Dynamsoft Capture Vision Router Lite Flutter +description: The enumeration PresetTemplate of Dynamsoft Capture Vision Router describes the preset template. +keywords: CaptureVisionTemplate, EnumPresetTemplate, single barcode template, speed first, read-rate first, template, preset +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +breadcrumbText: EnumPresetTemplate +--- + +# EnumPresetTemplate + +`EnumPresetTemplate` is an enumeration of preset templates that are configured for different recognition tasks, depending on the functional product as well as the desired performance from that functional product. These strings can be used when specifying template name with the [`startCapturing`](../capture-vision-router-lite/capture-vision-router.md#startcapturing) or [`capture`](../capture-vision-router-lite/capture-vision-router.md#capture) methods of the [`CaptureVisionRouter`](../capture-vision-router-lite/capture-vision-router.md). + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +static class EnumPresetTemplate +{ + static const defaultTemplate = "Default"; + static const readBarcodes = "ReadBarcodes_Default"; // the default template for the Barcode Reader that offers a balance between speed and read rate + static const readBarcodesSpeedFirst = "ReadBarcodes_SpeedFirst"; // prioritizes speed over read rate when reading barcodes + static const readBarcodesReadRateFirst = "ReadBarcodes_ReadRateFirst"; // prioritizes read rate over speed when reading barcodes + static const readSingleBarcode = "ReadSingleBarcode"; // focuses on the single-scan barcode reading mode and should not be used when reading multiple barcodes at a time +} +``` diff --git a/programming/flutter/api-reference/enum/result-status.md b/programming/flutter/api-reference/enum/result-status.md new file mode 100644 index 00000000..31a7ff36 --- /dev/null +++ b/programming/flutter/api-reference/enum/result-status.md @@ -0,0 +1,26 @@ +--- +layout: default-layout +title: EnumResultStatus - Dynamsoft Barcode Reader Flutter Edition +description: EnumResultStatus of DynamsoftBarcodeReader MAUI is an enumeration class that defines the result status of the BarcodeScanResult. +keywords: BarcodeReader, BarcodeScanResult, EnumResultStatus +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: EnumResultStatus +--- + +# EnumResultStatus + +`EnumResultStatus` is a enumeration that defines the result status of the associated `BarcodeScanResult`. + +## Definition + +*Assembly:* dynamsoft_barcode_reader_bundle_flutter + +```dart +enum EnumResultStatus +{ + finished, + canceled, + exception +} +``` diff --git a/programming/flutter/api-reference/enum/scanning-mode.md b/programming/flutter/api-reference/enum/scanning-mode.md new file mode 100644 index 00000000..33c9e54e --- /dev/null +++ b/programming/flutter/api-reference/enum/scanning-mode.md @@ -0,0 +1,25 @@ +--- +layout: default-layout +title: EnumScanningMode - Dynamsoft Barcode Reader Flutter Edition +description: EnumScanningMode of DynamsoftBarcodeReader Flutter is an enumeration class that defines the scanning mode. +keywords: BarcodeScanner, ScanningMode, flutter, +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: EnumScanningMode +--- + +# EnumScanningMode + +`EnumScanningMode` is a enumeration class that determines the scanning mode that the `BarcodeScanner` instance will operate in. + +## Definition + +*Assembly:* dynamsoft_barcode_reader_bundle_flutter + +```dart +enum EnumScanningMode +{ + single, // used for scanning a single barcode at a time, prioritizing speed over read rate + multiple // used for scanning multiple barcodes at a time, finding a balance between speed and read rate +} +``` diff --git a/programming/flutter/api-reference/index.md b/programming/flutter/api-reference/index.md new file mode 100644 index 00000000..e5ba36e5 --- /dev/null +++ b/programming/flutter/api-reference/index.md @@ -0,0 +1,71 @@ +--- +layout: default-layout +title: Dynamsoft Barcode Reader Flutter API Reference - Main Page +description: This is the main page of Dynamsoft Barcode Reader SDK API Reference for Flutter. +keywords: api reference, Flutter, barcode reader +needAutoGenerateSidebar: true +noTitleIndex: true +needGenerateH3Content: true +--- + +# SDK Overview: Modules and Main APIs + +This page provides an overview of the various modules and highlights the most essential APIs that form the backbone of Dynamsoft Barcode Reader SDKs. + +## Modules Summary + +**dynamsoft_capture_vision_flutter** represents the Dynamsoft Capture Vision library - parent library that contains the foundational classes and methods for not only the Barcode Reader, but the other functional Dynamsoft products such as the Dynamsoft Label Recognizer and the Dynamsoft Document Normalizer. + +**dynamsoft_barcode_reader_bundle_flutter** is built on the Dynamsoft Capture Vision (DCV) framework, which includes multiple modules working together to achieve the full barcode reading functionality. This library gives the developer access to the `BarcodeScanner` class, a **ready-to-use barcode reader** that requires minimal effort and configuration and comes with a sophisticated and user-friendly UI. + +The hierarchical structure diagram below illustrates the various modules of the Barcode Reader SDK (with modules at the top depending on those below). + +
    +

    region-def

    +

    Modules hierarchical of the DBR SDK

    +
    + +> [!NOTE] +> Please note that *dynamsoft_barcode_reader_bundle_flutter* is dependent on *dynamsoft_capture_vision_flutter*. Including the *dynamsoft_barcode_reader_bundle_flutter* library will automatically include the *dynamsoft_capture_vision_flutter* library. + + + +## API Overview + +### Capture Vision Router + +The Dynamsoft Capture Vision Router class is the cornerstone of the Dynamsoft Capture Vision (DCV) architecture. It focuses on coordinating batch image processing and provides API for setting up image sources and result receivers, configuring workflows with parameters, and controlling processes. Dynamsoft Capture Vision helps connects the functional products of Dynamsoft under the same umbrella - allowing for easier integration and interchangeable API to control them all. + +This guide focuses on the Barcode Reader functional product. To learn how to use the foundational Capture Vision API to set up and run the Barcode Reader, please refer to the [User Guide (Foundational Edition)](../foundational-user-guide.md). + + + +### Barcode Reader + +The Barcode Reader can be implemented by two sets of API - each offering a different experience. + +#### BarcodeScanner Edition + +The first (and recommended) way is to use the BarcodeScanner API - which comes with a ready-to-use UI and a simpler configuration setup, allowing the developer to quickly and easily integrate barcode scanning into their Flutter app. The BarcodeScanner API uses the foundational Capture Vision API as a basis, but comes with its own API to allow for an easier development process. + +> [!TIP] +> To learn how to implement the Barcode Reader using the BarcodeScanner API, please read through the [Barcode Reader Integration Guide (Ready-To-Use Edition)](../user-guide.md). + +#### Foundational Edition + +The alternative is to use the foundational Capture Vision API directly. Even though using the foundational API is a bit more complicated than the ready-to-use BarcodeScanner API, the foundational API allows for more intricate control over the Barcode Reader configuration and settings. With this implementation, you will lose the ready-to-use UI, but in scenarios where the developer has their own customized UI, this could prove beneficial. + +> [!TIP] +> To learn how to implement the Barcode Reader using the foundational API, please read through the [Barcode Reader Integration Guide (Foundational Edition)](../foundational-user-guide.md). diff --git a/programming/flutter/driver-license-user-guide.md b/programming/flutter/driver-license-user-guide.md new file mode 100644 index 00000000..bd9efc24 --- /dev/null +++ b/programming/flutter/driver-license-user-guide.md @@ -0,0 +1,356 @@ +--- +layout: default-layout +title: Driver License Scanner Integration Guide +description: This is the user guide of Driver License Scanner Flutter Edition. +keywords: user guide, flutter, foundational, barcode, scanner, driver license, reader +needAutoGenerateSidebar: true +needGenerateH3Content: true +noTitleIndex: true +--- + +# Driver License Scanner Integration Guide + +This guide will focus on the specific use case of scanning driver licenses to quickly retrieve one's ID info. Similar to the [Foundational Integration Guide](guide-scan-barcodes-foundational-api.md), this guide will utilize the [`Capture Vision Foundational API`](./api-reference/capture-vision-router-lite/capture-vision-router.md) to get the driver license scanner up and running. + +> [!NOTE] +> The Driver License Scanner is composed of two foundational Dynamsoft products - the [Dynamsoft Barcode Reader](https://www.dynamsoft.com/barcode-reader/sdk-mobile/) and the Dynamsoft Code Parser. The Barcode Reader is responsible for capturing and decoding the PDF417 barcodes of the driver licenses. Afterwards, the barcode result needs to be parsed into human-readable fields, which is where the Code Parser comes into play. + +## Supported Driver License Types + +Driver licenses come with a PDF417 barcode (usually on the back) that encodes the holder's information. These driver licenses can come in different formats, which means different ways that the information is encoded into the barcode, or even the type of information that is encoded. + +### AAMVA Driver License + +AAMVA - the American Association of Motor Vehicle Administrators - defines the standard that the majority of North American driver licenses need to adhere to. You can learn more about AAMVA on their [website](https://www.aamva.org/). + +All versions of the AAMVA DL/ID specification (2000, 2003, 2005, 2009, 2010, 2011, 2012, 2013, 2016) are supported by the Dynamsoft Barcode Reader. + +### South Africa Driver License + +Support for South African driver licenses is limited - which means that the library is able to extract only a portion of the personal info that is encoded onto the driver license. Parsing of the full info from the driver license will come in a future version of the library. + +## System Requirements + +* Latest [Flutter SDK](https://flutter.dev/) +* Android: Android SDK (API Level 21+), platforms and developer tools + * Supported OS: Android 5.0 (API Level 21) and higher + * Supported ABI: armeabi-v7a, arm64-v8a, x86 and x86_64 + * Development Environment: Android Studio Meerkat (2024.3.1); Java 17+; Gradle 8.0+ +* iOS + * Supported OS: iOS 13+ + * Supported ABI: arm64 and x86_64 + * Development Environment: Xcode 13+ (Xcode 14.1+ recommended) + +> [!TIP] +> If you are downloading Xcode or Android Studio for the first time, please remember to also install the command-line tools. + +## Including the Library + +1. Run the following command in the root directory of your flutter project to add `dynamsoft_capture_vision_flutter` to the dependencies. + +```bash +flutter pub add dynamsoft_capture_vision_flutter +``` + +2. Then run the following command to install all the dependencies: + +```bash +flutter pub get +``` + +## Building the Driver License Scanner Widget + +Now that the package is added, it's time to start building the Driver License Scanner widget. Unlike the default implementation of the Barcode Reader that is explored in the other guides, building the driver license scanner requires a few more steps and classes to be implemented to fully represent the parsed result that is produced by the library. + +These steps include importing the library, implementing the scanner page, creating the DriverLicenseScanResult class, and then putting them all together in the `main.dart` of the application. + +### Importing the Library + +To use the Capture Vision API, please import `dynamsoft_capture_vision_flutter` into the three files that we will be implementing (`main.dart`/`scan_page.dart`/`driver_license_scan_result.dart`): + +```dart +import 'package:dynamsoft_capture_vision_flutter/dynamsoft_capture_vision_flutter.dart'; +``` + +### Implementing the Widget + +Let's tackle the first and main component, the `ScannerPage` class which will be implemented in `scan_page.dart`. In order to implement the full driver license scanner workflow, the following needs to be done in order: + +- Define a valid license via the [`LicenseManager`](./api-reference/capture-vision-router-lite/license-manager.md) +- Initialize the [`CameraEnhancer`](./api-reference/capture-vision-router-lite/camera-enhancer.md) object +- Initialize the [`CaptureVisionRouter`](./api-reference/capture-vision-router-lite/capture-vision-router.md) object +- Bind the `CameraEnhancer` object to the `CaptureVisionRouter` object +- Register a [`CapturedResultReceiver`](./api-reference/capture-vision-router-lite/captured-result-receiver.md) object to listen for parsed driver license barcode results via the callback function [`onParsedResultsReceived`](./api-reference/capture-vision-router-lite/captured-result-receiver.md#ondecodedbarcodesreceived) +- Open the camera +- Start scanning via the [`startCapturing`](./api-reference/capture-vision-router-lite/capture-vision-router.md#startcapturing) method while being configured to the `ReadDriversLicense` template. + +The code snippet below shows the simplest implementation of `ScannerPage` that will set up and launch the Driver License Scanner. Please note that in order to use the Driver License Scanner, a **valid license must be defined in the code**. + +```dart +import 'package:dynamsoft_capture_vision_flutter/dynamsoft_capture_vision_flutter.dart'; +import 'package:flutter/material.dart'; + +import 'driver_license_scan_result.dart'; + +class ScannerPage extends StatefulWidget { + const ScannerPage({super.key}); + + @override + State createState() => _ScannerPageState(); +} + +class _ScannerPageState extends State with RouteAware { + final CaptureVisionRouter _cvr = CaptureVisionRouter.instance; + final CameraEnhancer _camera = CameraEnhancer.instance; + final String _templateName = "ReadDriversLicense"; + late final CapturedResultReceiver _receiver = CapturedResultReceiver() + ..onParsedResultsReceived = (ParsedResult result) async { + if (result.items?.isNotEmpty ?? false) { + _cvr.stopCapturing(); + final data = DriverLicenseData.fromParsedResultItem(result.items![0]); + if (data != null) { + final scanResult = DriverLicenseScanResult(resultStatus: EnumResultStatus.finished, data: data); + Navigator.pop(context, scanResult); + } else { + _cvr.startCapturing(_templateName); // restart capturing + } + } + }; + + @override + void initState() { + super.initState(); + PermissionUtil.requestCameraPermission(); + LicenseManager.initLicense('DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9').then((data) { + final (isSuccess, message) = data; + if (!isSuccess) { + print("license error: $message"); + } + }); + initSdk(); + } + + void initSdk() async { + await _cvr.setInput(_camera); + _cvr.addResultReceiver(_receiver); + _camera.open(); + try { + await _cvr.startCapturing(_templateName); + } catch (e) { + Navigator.of(context).pop( + DriverLicenseScanResult( + resultStatus: EnumResultStatus.error, + errorString: e.toString(), + ) + ); + } + } + + @override + void dispose() { + super.dispose(); + _cvr.stopCapturing(); + _camera.close(); + _cvr.removeResultReceiver(_receiver); + } + + @override + Widget build(BuildContext context) { + return PopScope( + canPop: false, + onPopInvokedWithResult: (bool didPop, Object? _) { + if (didPop) { + return; + } + final scanResult = DriverLicenseScanResult(resultStatus: EnumResultStatus.cancelled); + Navigator.pop(context, scanResult); + }, + child: Scaffold( + appBar: AppBar(backgroundColor: Theme.of(context).colorScheme.inversePrimary, title: Text("Scanner")), + body: Stack( + children: [Center(child: CameraView(cameraEnhancer: _camera))], + ), + ), + ); + } +} +``` + +> [!NOTE] +> +> - `DriverLicenseData.fromParsedResultItem()` is a helper function to convert a [`ParsedResultItem`](https://pub.dev/documentation/dynamsoft_capture_vision_flutter/latest/dynamsoft_capture_vision_flutter/ParsedResultItem-class.html) into a more user-friendly structure (`DriverLicenseData`). You can get the source code from [driver_license_scan_result.dart](https://github.com/Dynamsoft/barcode-reader-flutter-samples/blob/main/ScanDriversLicense/lib/driver_license_scan_result.dart). +>- The license string here grants a time-limited free trial which requires network connection to work. +>- You can request a 30-day trial license via the [Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=guide&package=mobile) portal. + +### Implementing the DriverLicenseScanResult Class + +The next step in building this app is to create the `DriverLicenseScanResult` class which will be used to represent the parsed information that is output by the library. **For the full implementation of this class, please refer to [*driver_license_scan_result.dart*](ScanDriversLicense/lib/driver_license_scan_result.dart)**. Here is a quick breakdown of the `DriverLicenseScanResult` class: + +- `resultStatus` represents whether the result was produced successfully, if the scan operation was cancelled, or if an error occurred during the scanning process. +- `data` is a `DriverLicenseData` object that represents the parsed information as different string fields which can then be accessed via these key fields and presented to the user in a friendly manner. + - `DriverLicenseData` is created from a `ParsedResultItem` object via the `fromParsedResultItem()` function that is defined in the `DriverLicenseData` class. +- `errorString` is the error message that is produced should the `resultStatus` be `exception`. + +### Finalizing the App + +Now that the main Scanner widget and the `DriverLicenseScanResult` class are implemented, it's time to bring them together in the *main.dart* of the project. For the full implementation of *main.dart*, please see the code below: + +```dart +import 'package:flutter/material.dart'; + +import 'driver_license_scan_result.dart'; +import 'scan_page.dart'; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + // This widget is the root of your application. + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Scan Drivers\' License', + theme: ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Colors.orange)), + home: const MyHomePage(title: 'Scan Drivers\' License'), + ); + } +} + +class MyHomePage extends StatefulWidget { + const MyHomePage({super.key, required this.title}); + + final String title; + + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + String _scanResult = ''; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(backgroundColor: Theme.of(context).colorScheme.inversePrimary, title: Text(widget.title)), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text(_scanResult, style: const TextStyle(fontSize: 16)), + const SizedBox(height: 20), + TextButton( + onPressed: () async { + final result = await Navigator.push(context, MaterialPageRoute(builder: (context) => const ScannerPage())) as DriverLicenseScanResult; + + setState(() { + if (result.resultStatus == EnumResultStatus.finished) { + _scanResult = result.data! + .toMap() + .entries + .map((entry) { + return "${entry.key}: ${entry.value}"; + }) + .join("\n"); + } else if (result.resultStatus == EnumResultStatus.cancelled) { + _scanResult = 'Scan cancelled'; + } else if (result.resultStatus == EnumResultStatus.error) { + _scanResult = 'Error message: ${result.errorString}'; + } + }); + }, + style: TextButton.styleFrom(backgroundColor: Colors.orange, foregroundColor: Colors.white), + child: const Text('Open Drivers\' License Scanner'), + ), + const SizedBox(height: 50), + ], + ), + ), + ); + } +} +``` + +## Customize the Driver License Scanner + +Even though the Driver License Scanner comes with a template that is optimized for the typical driver license scanning scenario, there could be situations that require a different approach in order to get handled properly. The Driver License Scanner comes with a wide range of customizations, whether it is UI related, performance related, or a mix of both. + +In this next section we will explore one of the ways in which the Driver License Scanner can be customized - specifying a scan region. + +### Specify the Scan Region + +You can limit the scan region of the library so that it doesn't exhaust resources trying to read from the entire image or frame. + +```dart +import 'package:dynamsoft_capture_vision_flutter/dynamsoft_capture_vision_flutter.dart'; + +final CameraEnhancer _camera = CameraEnhancer.instance; + +void initSdk() async { + //...... + final scanRegion = DSRect(left: 0.1, top: 0.4, right: 0.9, bottom: 0.6, measuredInPercentage: true); + _camera.setScanRegion(scanRegion); +} +``` + + +## Run the Project + +### Camera Permissions + +#### iOS + +Before the project can be deployed to a *iOS* device, the camera permissions and the developer signature must first be set. To add the camera permissions to the iOS portion of the app, we recommend first installing the **pods** dependencies to generate the **.xcworkspace** project under the ios folder (`ios/Runner.xcworkspace`). Please run the following commands from the root directory: + +```bash +cd ios/ +pod install --repo-update +``` + +Once the pods are installed, *Runner.xcworkspace* should now be generated in the *ios* folder. To add the camera permissions, open the generated *Runner.xcworkspace* and navigate to the *Info* section of the project settings. Then you must add the "Privacy - Camera Usage Description" key to the list (where you can also assign a string message to show in the alert box). + +#### Android + +On Android, permission to use the camera must be set in the code as such: + +```dart +import 'package:dynamsoft_capture_vision_flutter/dynamsoft_capture_vision_flutter.dart'; + +PermissionUtil.requestCameraPermission(); +``` + +> [!NOTE] +> Please note that the code snippets in the previous sections contain this line in order to make the app run successfully. + +### Deploying to Device + +#### Android + +Go to the project folder, open a new terminal and run the following command: + +```bash +flutter run -d +``` + +You can get the IDs of all connected (physical) devices by running the command `flutter devices`. + +#### iOS + +In order to deploy the app to a iOS device, we recommend doing it via Xcode by using the `Runner.xcworkspace` project that was generated when the pods were installed. Since the camera permissions are taken care of, all you need to do is properly configure the *Signing & Capabilities* section of the project settings. Should the iOS device be connected to the computer, you can now run and deploy the app to the device. + +If everything is set up correctly, you should see the app running on your device. + +## Full Sample Code + +The full sample code is available [here](./ScanDriversLicense). + +## License + +- You can request a 30-day trial license via the [Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=github&package=mobile) portal. + +## Support + +https://www.dynamsoft.com/company/contact/ diff --git a/programming/flutter/foundational-user-guide.md b/programming/flutter/foundational-user-guide.md new file mode 100644 index 00000000..46505c66 --- /dev/null +++ b/programming/flutter/foundational-user-guide.md @@ -0,0 +1,291 @@ +--- +layout: default-layout +title: Barcode Reader Integration Guide (Foundational Edition) +description: This is the user guide of Dynamsoft Barcode Reader Flutter SDK (Foundational Edition). +keywords: user guide, flutter, ready to use, barcode, scanner +needAutoGenerateSidebar: true +needGenerateH3Content: true +noTitleIndex: true +--- + +# Barcode Reader Integration Guide (Foundational Edition) + +This guide will help you develop a barcode scanning app using the [Dynamsoft Capture Vision Foundational API](./api-reference/capture-vision-router-lite/capture-vision-router.md). + +Dynamsoft Capture Vision (DCV) is an aggregating library for several of Dynamsoft's functional products, including the Dynamsoft Barcode Reader SDK. The [`Capture Vision API`](./api-reference/capture-vision-router-lite/capture-vision-router.md) does not come with a pre-built UI like the BarcodeScanner component (see this [guide](user-guide.md)) - it does provide the user with more parameters to control the barcode reading performance and settings. + +## Supported Barcode Symbologies + +| Linear (1D) Barcodes | 2D Barcodes | Others | +| :------------------- | :---------- | :----- | +| Code 39 (including Code 39 Extended)
    Code 93
    Code 128
    Codabar
    Interleaved 2 of 5
    EAN-8
    EAN-13
    UPC-A
    UPC-E
    Industrial 2 of 5







    | QR Code (including Micro QR Code and Model 1)
    Data Matrix
    PDF417 (including Micro PDF417)
    Aztec Code
    MaxiCode (mode 2-5)
    DotCode











    | Patch Code

    GS1 Composite Code

    GS1 DataBar
  • Omnidirectional
  • Truncated, Stacked
  • Stacked Omnidirectional, Limited
  • Expanded, Expanded Stacked

  • Postal Codes
  • USPS Intelligent Mail
  • Postnet
  • Planet
  • Australian Post
  • UK Royal Mail
  • | + +## System Requirements + +* Latest [Flutter SDK](https://flutter.dev/) +* Android: Android SDK (API Level 21+), platforms and developer tools + * Supported OS: Android 5.0 (API Level 21) and higher + * Supported ABI: armeabi-v7a, arm64-v8a, x86 and x86_64 + * Development Environment: Android Studio Meerkat (2024.3.1); Java 17+; Gradle 8.0+ +* iOS + * Supported OS: iOS 13+ + * Supported ABI: arm64 and x86_64 + * Development Environment: Xcode 13+ (Xcode 14.1+ recommended) + +> [!TIP] +> If you are downloading Xcode or Android Studio for the first time, please remember to also install the command-line tools. + +## Including the Library + +1. Run the following command in the root directory of your flutter project to add `dynamsoft_capture_vision_flutter` to the dependencies + +```bash +flutter pub add dynamsoft_capture_vision_flutter +``` + +2. Then run the following command to install all the dependencies: + +```bash +flutter pub get +``` + +## Building the Barcode Reader Widget + +Now that the package is added, it's time to start building the Barcode Reader widget. + +### Importing the Library + +To use the Capture Vision API, please import `dynamsoft_capture_vision_flutter` in *main.dart*: + +```dart +import 'package:dynamsoft_capture_vision_flutter/dynamsoft_capture_vision_flutter.dart'; +``` + +### Quick Start + +In order to implement the full barcode reader workflow, the following needs to be done in order: + +- Define a valid license via the [`LicenseManager`](./api-reference/capture-vision-router-lite/license-manager.md) +- Initialize the [`CameraEnhancer`](./api-reference/capture-vision-router-lite/camera-enhancer.md) object +- Initialize the [`CaptureVisionRouter`](./api-reference/capture-vision-router-lite/capture-vision-router.md) object +- Bind the `CameraEnhancer` object to the `CaptureVisionRouter` object +- Register a [`CapturedResultReceiver`](./api-reference/capture-vision-router-lite/captured-result-receiver.md) object to listen for decoded barcodes via the callback function [`onDecodedBarcodesReceived`](./api-reference/capture-vision-router-lite/captured-result-receiver.md#ondecodedbarcodesreceived) +- Open the camera +- Start barcode scanning via the [`startCapturing`](./api-reference/capture-vision-router-lite/capture-vision-router.md#startcapturing) method + +The code snippet below shows the simplest implementation that will set up and launch the Barcode Reader. Please note that in order to use the Barcode Reader, a **valid license must be defined in the code**. + +```dart +import 'package:dynamsoft_capture_vision_flutter/dynamsoft_capture_vision_flutter.dart'; +import 'package:flutter/material.dart'; + +class MyHomePage extends StatefulWidget { + const MyHomePage({super.key}); + + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + final CaptureVisionRouter _cvr = CaptureVisionRouter.instance; + final CameraEnhancer _camera = CameraEnhancer.instance; + final String _templateName = EnumPresetTemplate.readBarcodes; + late final CapturedResultReceiver _receiver = CapturedResultReceiver() + ..onDecodedBarcodesReceived = (DecodedBarcodesResult result) async { + if (result.items?.isNotEmpty ?? false) { + // assign the barcode + 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); + } + }; + + @override + void initState() { + super.initState(); + PermissionUtil.requestCameraPermission(); + LicenseManager.initLicense('DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9').then((data) { + final (isSuccess, message) = data; + if (!isSuccess) { + print("license error: $message"); + } + }); + initSdk(); + } + + void initSdk() async { + await _cvr.setInput(_camera); //bind CameraEnhancer and CaptureVisonRouter + _cvr.addResultReceiver(_receiver); //Register `CapturedResultReceiver` object to listen for parsed decoded barcodes result + _camera.open(); + try { + await _cvr.startCapturing(_templateName); //Start capturing + } catch (e) { + print(e); + } + } + + void showTextDialog(String title, String message, VoidCallback? onDismiss) { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog(title: Text(title), content: Text(message)); + }, + ).then((_) { + //Callback when dialog dismissed + onDismiss?.call(); + }); + } + + @override + void dispose() { + super.dispose(); + _cvr.stopCapturing(); + _camera.close(); + _cvr.removeResultReceiver(_receiver); + } + + @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)), // Bind CameraView and CameraEnhancer + ); + } +} +``` + +> [!NOTE] +> +>- The license string here grants a time-limited free trial which requires network connection to work. +>- You can request a 30-day trial license via the [Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=guide&package=mobile) portal. + +## Configuring the Barcode Reader (Optional) + +The Barcode Reader library comes with many customization parameters that can affect the performance of the SDK. Whether you are looking speed up the scan process or increase the read rate when reading a batch of barcodes at once, these parameters can prove to be quite useful in making the Barcode Reader adapt to any kind of situation that it is put in. + +> [!TIP] +> The Barcode Reader settings can be changed in two ways: +> 1. Using the [`SimplifiedBarcodeReaderSettings`](./api-reference/capture-vision-router-lite/simplified-barcode-reader-settings.md) class (via the [`SimplifiedCaptureVisionSettings`](./api-reference/capture-vision-router-lite/simplified-capture-vision-settings.md) class) and the [`updateSettings`](./api-reference/capture-vision-router-lite/capture-vision-router.md#updatesettings) method. +> 2. Using a JSON template file that contains the algorithm parameters, which is then applied using the [`initSettings`](./api-reference/capture-vision-router-lite/capture-vision-router.md#initsettings) method. +> +> If you are looking to create a custom JSON settings template, please refer to this [page](https://www.dynamsoft.com/barcode-reader/docs/core/programming/features/use-runtimesettings-or-templates.html?lang=objc,swift#json-template). + +### Specify Barcode Formats and Count + +One of the main parameters that is available to the Barcode Reader is the `barcodeFormatIds` - which sets what barcode symbologies will be read. Another one of those parameters is the `expectedBarcodesCount` - which specifies how many barcodes are expected to be read in a frame or image. Now let's see the ways we can configure these parameters + +#### Using `SimplifiedCaptureVisionSettings` + +```dart +import 'package:dynamsoft_capture_vision_flutter/dynamsoft_capture_vision_flutter.dart'; + +final _cvr = CaptureVisionRouter.instance; +final _templateName = EnumPresetTemplate.readBarcodes; //"ReadBarcodes_Default" + +void initSdk() async { + //... + SimplifiedCaptureVisionSettings? settings = await _cvr.getSimplifiedSettings(_templateName); + settings!.timeout = 1000; // set timeout to 1 second for each frame scan + + // Set the expected barcode count to 0 when you are not sure how many barcodes you are scanning. + // Set the expected barcode count to 1 can maximize the barcode decoding speed. + settings.barcodeSettings!.expectedBarcodesCount = 0; + + settings.barcodeSettings!.barcodeFormatIds = EnumBarcodeFormat.oned |EnumBarcodeFormat.qrCode | EnumBarcodeFormat.pdf417 | EnumBarcodeFormat.datamatrix; + //In this case, only timeout, expectedBarcodesCount and barcodeFormatIds will be updated and undefined properties will retain their original values. + _cvr.updateSettings(settings, _templateName); + _cvr.startCapturing(_templateName); + //... +} +``` + +#### Using a JSON Template + +```dart +import 'package:dynamsoft_capture_vision_flutter/dynamsoft_capture_vision_flutter.dart'; +final _cvr = CaptureVisionRouter.instance; + +void initSettings() async { + //... + _cvr.initSettings("{the JSON template as a raw JSON string}"); + //... + router.startCapturing("{your template name in the template String}"); +} +``` + +> [!NOTE] +> To learn how to create your own JSON template, please refer to this [page](https://www.dynamsoft.com/barcode-reader/docs/core/programming/features/use-runtimesettings-or-templates.html?lang=objc,swift#json-template). + +### Specify the Scan Region + +You can also limit the scan region of the SDK so that it doesn't exhaust resources trying to read from the entire image or frame. + +```dart +import 'package:dynamsoft_capture_vision_flutter/dynamsoft_capture_vision_flutter.dart'; + +final CameraEnhancer _camera = CameraEnhancer.instance; + +void initSdk() async { + //...... + final scanRegion = DSRect(left: 0.1, top: 0.4, right: 0.9, bottom: 0.6, measuredInPercentage: true); + _camera.setScanRegion(scanRegion); +} +``` + +## Run the Project + +### Camera Permissions + +#### iOS + +Before the project can be deployed to a *iOS* device, the camera permissions and the developer signature must first be set. To add the camera permissions to the iOS portion of the app, we recommend first installing the **pods** dependencies to generate the **.xcworkspace** project under the ios folder (`ios/Runner.xcworkspace`). Please run the following commands from the root directory: + +```bash +cd ios/ +pod install --repo-update +``` + +Once the pods are installed, *Runner.xcworkspace* should now be generated in the *ios* folder. To add the camera permissions, open the generated *Runner.xcworkspace* and navigate to the *Info* section of the project settings. Then you must add the "Privacy - Camera Usage Description" key to the list (where you can also assign a string message to show in the alert box). + +#### Android + +On Android, permission to use the camera must be set in the code as such: + +```dart +import 'package:dynamsoft_capture_vision_flutter/dynamsoft_capture_vision_flutter.dart'; + +PermissionUtil.requestCameraPermission(); +``` + +> [!NOTE] +> Please note that the code snippets in the previous sections contain this line in order to make the app run successfully. + +### Deploying to Device + +#### Android + +Go to the project folder, open a new terminal and run the following command: + +```bash +flutter run -d +``` + +You can get the IDs of all connected (physical) devices by running the command `flutter devices`. + +#### iOS + +In order to deploy the app to a iOS device, we recommend doing it via Xcode by using the `Runner.xcworkspace` project that was generated when the pods were installed. Since the camera permissions are taken care of, all you need to do is properly configure the *Signing & Capabilities* section of the project settings. Should the iOS device be connected to the computer, you can now run and deploy the app to the device. + +If everything is set up correctly, you should see the app running on your device. + +## Full Sample Code + +The full sample code is available [here](https://github.com/Dynamsoft/barcode-reader-flutter-samples/tree/main/ScanBarcodes_FoundationalAPI). + +## License + +- You can request a 30-day trial license via the [Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=github&package=mobile) portal. + +## Support + +https://www.dynamsoft.com/company/contact/ diff --git a/programming/flutter/index.md b/programming/flutter/index.md new file mode 100644 index 00000000..ba83cc2f --- /dev/null +++ b/programming/flutter/index.md @@ -0,0 +1,73 @@ +--- +layout: default-layout +title: Main Page - Dynamsoft Barcode Reader for Flutter +description: This is the main page of Dynamsoft Barcode Reader for Flutter SDK. +keywords: Flutter, barcode reader +needAutoGenerateSidebar: false +breadcrumbText: Flutter +--- + +# Dynamsoft Barcode Reader Flutter Edition + +Dynamsoft Barcode Reader (DBR) SDK Flutter Edition is a barcode reading tool designed specifically for Flutter developers. + +DBR Flutter provides rich API for developers to easily integrate barcode reading functionality into your Flutter applications. When you start the development journey with DBR Flutter, you can choose the **Ready-To-Use Edition** or the **Foundational Edition** - with each providing its own set of benefits. + +- **Ready-To-Use Edition**: This edition of the library comes with its own, built-in, sophisticated UI for the camera view. This edition also simplifies the Barcode Reader configuration and focuses on the core configurations of the Barcode Reader. Overall, this edition allows the developer to spend less time worrying about the UI and the extra steps needed to configure the Barcode Reader, but takes away some of the more intricate configurations that can be applied to the Barcode Reader. +- **Foundational Edition**: This edition of the library is built using the foundational Capture Vision API - allowing the user more detailed control over the initialization and configuration of the Barcode Reader. This edition does not come with a built-in UI like the Ready-To-Use Edition, so the UI setup will fall on the developer. However, using the Foundational Edition does open up a larger variety of parameters that can be controlled via the settings (which can still be used in the RTU Edition, but only via a JSON template). + +Furthermore, DBR provides a powerful parameter system in order to cope with various scenarios. Read Parameter Reference for details. + +## Using the SDK + +### System Requirements + +#### Flutter + +- Latest [Flutter framework](https://flutter.dev/) (Flutter 3.35) + +#### Android + +- Android SDK (API Level 21+), platforms and developer tools +- Supported OS: Android 5.0 (API Level 21) and higher +- Supported ABI: armeabi-v7a, arm64-v8a, x86 and x86_64 +- Development Environment: Android Studio Meerkat (2024.3.1); Java 17+; Gradle 8.0+ + +#### iOS + +- Supported OS: iOS 13+ +- Supported ABI: arm64 and x86_64 +- Development Environment: Xcode 13+ (Xcode 14.1+ recommended) + +### User Guide + +* [Barcode Reader Integration Guide (Ready-To-Use Edition)](user-guide.md) +* [Barcode Reader Integration Guide (Foundational Edition)](foundational-user-guide.md) +* [Driver License Integration Guide](driver-license-user-guide.md) + +### Samples + +* [Github Samples Repo](https://github.com/dynamsoft/barcode-reader-flutter-samples){:target="_blank"} + +### API Reference + +While the guide covers common APIs, more detailed explanations of these and other APIs can be found in the [API Reference](./api-reference/index.md). + + + +## License Subscription + +To develop and run your application with Dynamsoft Barcode Reader SDK, you need an active license key: + +* Request a 30-day free trial license + +## Online Store + +* Online store + +## Contact Us + +Feel free to [contact us](https://www.dynamsoft.com/company/customer-service/#contact){:target="_blank"} if you have any questions. diff --git a/programming/flutter/release-notes/index.md b/programming/flutter/release-notes/index.md new file mode 100644 index 00000000..0f31274a --- /dev/null +++ b/programming/flutter/release-notes/index.md @@ -0,0 +1,24 @@ +--- +layout: default-layout +title: MAUI Release Notes - Dynamsoft Barcode Reader Flutter SDK +description: This is the release notes page of Dynamsoft Barcode Reader for Flutter SDK. +keywords: release notes, Flutter, barcode reader +needAutoGenerateSidebar: false +breadcrumbText: Release Notes +--- + +# Dynamsoft Barcode Reader Flutter SDK - Release Notes + +## 11.0.5201 (08/28/2025) + +### Highlighted Features + +- Updated the `dynamsoft_capture_vision_flutter` package to include Dynamsoft Capture Vision 3.0.5200 to make use of all the new and enhanced features of Dynamsoft Capture Vision. +- Introduced the **BarcodeScanner** class that offers a **ready-to-use** UI and configuration, making it easier to get the Barcode Reader up and running in a Flutter app +- Updated the underlying Flutter version to Flutter 3.35 for the latest updates in the Flutter framework + +> [!NOTE] +> If you would like to learn of the full release notes of Dynamsoft Capture Vision, please visit the [DCV iOS Release Notes]({{ site.dcvb_ios_release_notes }}ios-3.html) and the [DCV Android Release Notes]({{ site.dcvb_android_release_notes }}android-3.html). +> +> To learn of all the changes and highlights in the version history of Dynamsoft Barcode Reader, please visit the [DBR iOS Release Notes]({{ site.oc_release_notes }}) and the [DBR Android Release Notes]({{ site.android_release_notes }}). + diff --git a/programming/flutter/samples/index.md b/programming/flutter/samples/index.md new file mode 100644 index 00000000..88510d21 --- /dev/null +++ b/programming/flutter/samples/index.md @@ -0,0 +1,41 @@ +--- +layout: default-layout +title: Demo & Samples - Dynamsoft Barcode Reader Flutter Edition +description: The index of Dynamsoft Barcode Reader Flutter demo & samples. +keywords: demo, sample, index, Flutter, barcode reader +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# Demo and Samples + +All of the samples that have been created for the Dynamsoft Barcode Reader Flutter Edition are hosted in this Github repo. Feel free to use these samples as reference when building your own Flutter app. + +## Barcode Reader Samples + +### ScanBarcodes_FoundationalAPI + +This is a sample that demonstrates the simplest implementation of the Barcode Reader to allow for barcode decoding via the camera using the [Capture Vision Foundational API](../api-reference/capture-vision-router-lite/capture-vision-router.md). + +[Check code on GitHub](https://github.com/Dynamsoft/barcode-reader-flutter-samples/tree/main/ScanBarcodes_FoundationalAPI){:target="_blank"} + +### ScanBarcodes_ReadyToUseComponent + +This is a sample that demonstrates the simplest implementation of the Barcode Reader to allow for barcode decoding via the camera using the [BarcodeScanner (Ready-To-Use) API](../api-reference/barcode-scanner/barcode-scanner.md). + +[Check code on GitHub](https://github.com/Dynamsoft/barcode-reader-flutter-samples/tree/main/ScanBarcodes_ReadyToUseComponent){:target="_blank"} + +### ScanDriverLicense + +This sample demonstrates the simplest implementation of the Barcode Reader for recognizing a PDF417 barcode from video streaming and extracting structured data from its encoded data. + +[Check code on GitHub](https://github.com/Dynamsoft/barcode-reader-flutter-samples/tree/main/ScanDriversLicense){:target="_blank"} + +## Demos + +If you would like to see the Barcode Reader in action before starting the development journey, we have a demo app available on both the App Store as well as the Google Play Store. + +- Barcode Scanner Demo + - [View in Google Play Store](https://play.google.com/store/apps/details?id=com.dynamsoft.demo.dynamsoftbarcodereaderdemo&pli=1){:target="_blank"} + - [Download APK](https://download2.dynamsoft.com/dbr/android/DynamsoftBarcodeReaderDemoAndroid.apk) + - [View in App Store](https://apps.apple.com/us/app/dynamsoft-barcode-scanner-demo/id1120581630){:target="_blank"} \ No newline at end of file diff --git a/programming/flutter/upgrade.md b/programming/flutter/upgrade.md new file mode 100644 index 00000000..790e3dea --- /dev/null +++ b/programming/flutter/upgrade.md @@ -0,0 +1,56 @@ +--- +layout: default-layout +title: How to update - Dynamsoft Barcode Reader for Android +description: Follow the upgrade instructions to learn to upgrade Barcode Reader SDK Android edition from 10 to 11. +keywords: updates guide, android +needAutoGenerateSidebar: true +needGenerateH3Content: true +noTitleIndex: true +pageStartVer: 10.0 +--- + +# How to Upgrade + +## From Version 10.x to 11.x + +### Update the Libraries + +#### Visual Studio for Mac + +In the **NuGet Package Manager>Manage Packages for Solution** of your project, search for **Dynamsoft.BarcodeReaderBundle.Maui**. Select the latest version and click **install**. + +#### Visual Studio for Windows + +You need to add the library via the project file and complete additional steps for the installation. + +1. Add the library in the project file: + + ```xml + + ... + + ... + + + + ``` + +2. Open the **Package Manager Console** and run the following commands: + + ```bash + dotnet build + ``` + +> Note: +> +> - Please view [user guide](user-guide.md#option-1-add-the-library-via-maven) for the correct version number. +> - Windows system have a limitation of 260 characters in the path. If you don't use console to install the package, you will receive error "Could not find a part of the path 'C:\Users\admin\.nuget\packages\dynamsoft.imageprocessing.ios\2.4.300\lib\net7.0-ios16.1\Dynamsoft.ImageProcessing.iOS.resources\DynamsoftImageProcessing.xcframework\ios-arm64\dSYMs\DynamsoftImageProcessing.framework.dSYM\Contents\Resources\DWARF\DynamsoftImageProcessing'" +> - The library only support Android & iOS platform. Be sure that you remove the other platforms like Windows, maccatalyst, etc. + +### Update the Template File + +You can use the template converter to upgrade your template. View the [online template converter](https://www.dynamsoft.com/tools/template-upgrade/) + +## From version 9.x or earlier + +Dynamsoft Barcode Reader SDK has been refactored to integrate with DynamsoftCaptureVision (DCV) architecture since version 10. To upgrade from version 9.x or earlier to 11.x, we recommend you to follow the [User Guide](user-guide.md) and re-write your codes. This section highlights only the key changes and necessary actions for upgrading the SDK. diff --git a/programming/flutter/user-guide.md b/programming/flutter/user-guide.md new file mode 100644 index 00000000..d4bebdb4 --- /dev/null +++ b/programming/flutter/user-guide.md @@ -0,0 +1,289 @@ +--- +layout: default-layout +title: Barcode Reader Integration Guide (Ready-To-Use Edition) +description: This is the user guide of Dynamsoft Barcode Reader Flutter SDK (Ready-to-Use Edition). +keywords: user guide, flutter, ready to use, barcode, scanner +needAutoGenerateSidebar: true +needGenerateH3Content: true +noTitleIndex: true +--- + + +# Barcode Reader Integration Guide (Ready-To-Use Edition) + +This guide will help you develop a barcode scanning app with the [`BarcodeScanner`](api-reference/barcode-scanner/barcode-scanner.md) Ready-To-Use (RTU) component. + +The `BarcodeScanner` is a ready-to-use component that allows developers to quickly and seamlessly integrate barcode scanning into an application without needing to worry about the UI, allowing the developer to focus on other aspects of the application. + +Even though the UI comes with a default look, the [`BarcodeScanner` API](api-reference/barcode-scanner/barcode-scanner.md) provides the developer with customization options for the UI as well as control over the barcode scanning performance via a set of the basic parameters of barcode decoding that the library offers. + +## Supported Barcode Symbologies + +| Linear (1D) Barcodes | 2D Barcodes | Others | +| :------------------- | :---------- | :----- | +| Code 39 (including Code 39 Extended)
    Code 93
    Code 128
    Codabar
    Interleaved 2 of 5
    EAN-8
    EAN-13
    UPC-A
    UPC-E
    Industrial 2 of 5







    | QR Code (including Micro QR Code and Model 1)
    Data Matrix
    PDF417 (including Micro PDF417)
    Aztec Code
    MaxiCode (mode 2-5)
    DotCode











    | Patch Code

    GS1 Composite Code

    GS1 DataBar
  • Omnidirectional
  • Truncated, Stacked
  • Stacked Omnidirectional, Limited
  • Expanded, Expanded Stacked

  • Postal Codes
  • USPS Intelligent Mail
  • Postnet
  • Planet
  • Australian Post
  • UK Royal Mail
  • | + +## Requirements + +* Latest [Flutter SDK](https://flutter.dev/) +* Android: Android SDK (API Level 21+), platforms and developer tools + * Supported OS: Android 5.0 (API Level 21) and higher + * Supported ABI: armeabi-v7a, arm64-v8a, x86 and x86_64 + * Development Environment: Android Studio Meerkat (2024.3.1); Java 17+; Gradle 8.0+ +* iOS + * Supported OS: iOS 13+ + * Supported ABI: arm64 and x86_64 + * Development Environment: Xcode 13+ (Xcode 14.1+ recommended) + +> [!TIP] +> If you are downloading Xcode or Android Studio for the first time, please remember to also install the command-line tools. + +## Including the Library + +1. Run the following command in the root directory of your flutter project to add `dynamsoft-barcode-reader-bundle-flutter` to the dependencies + +```bash +flutter pub add dynamsoft-barcode-reader-bundle-flutter +``` + +2. Then run the following command to install all the dependencies: +```bash +flutter pub get +``` + +## Building the Barcode Scanner Widget + +Now that the package is added, it's time to start building the `BarcodeScanner` widget. + +### Importing the Library + +To use the BarcodeScanner API, please import `dynamsoft_barcode_reader_bundle_flutter` in *main.dart*: + +```dart +import 'package:dynamsoft_barcode_reader_bundle_flutter/dynamsoft_barcode_reader_bundle_flutter.dart'; +``` + +### Quick Start + +The code snippet below shows the simplest implementation of a function that will initialize and launch the Barcode Scanner. Please note that in order to use the Barcode Scanner, a **valid license must be defined in the code**. + +```dart +import 'package:dynamsoft_barcode_reader_bundle_flutter/dynamsoft_barcode_reader_bundle_flutter.dart'; + +void _launchBarcodeScanner() async{ + var config = BarcodeScannerConfig( + license: 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9', + ); + const result = await BarcodeScanner.launch(config); + if(result.status == EnumResultStatus.finished){ + // handle the result + } +} +``` + +The above function can be triggered on any event, like when the app starts, on a button click, or more. Once the barcode scanner is launched, a barcode scanning interface opens - allowing the user to point at any barcode with the phone camera in order to read the barcode(s). Once the scan is complete, the interface closes and the result is returned. + +> [!TIP] +> The Barcode Scanner is able to operate in a *single scan* mode or a *multiple scan* mode. In *single scan* mode, the barcode scanner can only capture one barcode at a time, even if there are multiple barcodes in the same frame or within the same view. In order to read multiple barcodes in the same frame or view, the barcode scanner needs to be in *multiple scan* mode. +> +> The scanning mode is determined by the `scanningMode` parameter of `BarcodeScannerConfig`. To use single scan mode, set `scanningMode` to *single*. To use multiple scan mode, set `scanningMode` to *multiple*. + +This next code snippet demonstrates a simple example on how to configure the `_launchBarcodeScanner` function in the full **main.dart** implementation. + +```dart +import 'package:flutter/material.dart'; +import 'package:dynamsoft_barcode_reader_bundle_flutter/dynamsoft_barcode_reader_bundle_flutter.dart'; + +class MyHomePage extends StatefulWidget { + final String title; + const MyHomePage({super.key, required this.title}); + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + String _displayString = ""; // used to show the barcode result + void _launchBarcodeScanner() async{ + var config = BarcodeScannerConfig( + license: 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9', + scanningMode: 'single', // configuring the Barcode Scanner into single scan mode + ); + const result = await BarcodeScanner.launch(config); + if(result.status == EnumResultStatus.finished){ + setState(() { + if (barcodeScanResult.status == EnumResultStatus.canceled) { + _displayString = "Scan canceled"; + } else if (barcodeScanResult.status == EnumResultStatus.exception) { + _displayString = "ErrorCode: ${barcodeScanResult.errorCode}\n\nErrorString: ${barcodeScanResult.errorMessage}"; + } else { + //EnumResultStatus.finished + if (scanningMode == EnumScanningMode.single) { + var barcode = barcodeScanResult.barcodes![0]; + _displayString = "Format: ${barcode!.formatString}\nText: ${barcode.text}"; + } else { + // EnumScanningMode.multiple + _displayString = + "Barcodes count: ${barcodeScanResult.barcodes!.length}\n\n" + "${barcodeScanResult.barcodes!.map((barcode) { + return "Format: ${barcode!.formatString}\nText: ${barcode.text}"; + }).join("\n\n")}"; + } + } + }); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text(widget.title)), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TextButton( + onPressed: _launchBarcodeScanner, + child: const Text("Scan Barcodes"), + ), + SizedBox(height: 20), + Padding( + padding: EdgeInsets.symmetric(horizontal: 20), + child: Text(_displayString, style: Theme.of(context).textTheme.bodyLarge), + ), + ], + ), + ) + ); + } +} +``` + +> [!NOTE] +>- The license string here grants a time-limited free trial which requires network connection to work. +>- You can request a 30-day trial license via the [Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=guide&package=mobile) portal. +>- The barcode result is displayed in a text label that is set by the `_displayString` variable. + +### Barcode Scan Result + +Also see it in the [BarcodeScanResult](api-reference/barcode-scanner/barcode-scan-result.md) section of API References. + +`BarcodeScanResult` structure: +- resultStatus: The status of the barcode result, of type `EnumResultStatus`. + - finished: The barcode scan was successful. + - canceled: The barcode scanning activity is closed before the process is finished. + - exception: Failed to start barcode scanning or an error occurs when scanning the barcodes. +- errorCode: The error code indicates if something went wrong during the barcode scanning process (0 means no error). +- errorString: The error message associated with the error code if an error occurs during barcode scanning process. +- barcodes: An array of `BarcodeResultItem`. + +### Configuring the BarcodeScanner (Optional) + +The advantage of using the BarcodeScanner component is in the simplicity of its configuration. As we have shown above, it doesn't take much to get the BarcodeScanner up and running. However, there could be cases where you want to make some changes to the default UI or setup that the BarcodeScanner provides. In this section, we run through the different configuration options provided in the [BarcodeScannerConfig](api-reference/barcode-scanner/barcode-scanner-config.md) class. + +```dart +const config = BarcodeScannerConfig( + + ///The license key required to initialize the BarcodeScanner. + license: "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", //The license string here grants a time-limited free trial which requires network connection to work. + + ///Sets the barcode format(s) to read. + ///This value is a combination of EnumBarcodeFormat flags that determine which barcode types to read. + ///For example, to scan QR codes and OneD codes, + ///set the value to `EnumBarcodeFormat.BF_QR_CODE | EnumBarcodeFormat.BF_ONED`. + barcodeFormats: EnumBarcodeFormat.BF_QR_CODE | EnumBarcodeFormat.BF_ONED, + + ///Defines the scanning area as a DSRect object where barcodes will be detected. + ///Only the barcodes located within this defined region will be processed. + ///Default is undefined, which means the full screen will be scanned. + scanRegion: DSRect(top: 0.25, bottom: 0.75, left: 0.25, right: 0.75, measuredInPercentage: true), // scan the middle 50% of the screen + + ///Determines whether the torch (flashlight) button is visible in the scanning UI. + ///Set to true to display the torch button, enabling users to turn the flashlight on/off. Default is true. + isTorchButtonVisible: true, + + ///Specifies if a beep sound should be played when a barcode is successfully detected. + ///Set to true to enable the beep sound, or false to disable it. Default is false. + isBeepEnabled: false, + + ///Enables or disables the auto-zoom feature during scanning. + ///When enabled (true), the scanner will automatically zoom in to improve barcode detection. Default is false. + isAutoZoomEnabled: false, + + ///Determines whether the close button is visible on the scanner UI. + ///This button allows users to exit the scanning interface. Default is true. + isCloseButtonVisible: true, + + ///Specifies whether the camera toggle button is displayed. + ///This button lets users switch between available cameras (e.g., front and rear). Default is false. + isCameraToggleButtonVisible: false, + + ///Determines if a scanning laser overlay is shown on the scanning screen. + ///This visual aid (scan laser) helps indicate the scanning line during barcode detection. Default is true. + isScanLaserVisible: true, + + ///Sets the scanning mode for the BarcodeScanner. + ///The mode is defined by the EnumScanningMode and affects the scanning behavior. Default is `EnumScanningMode.single`. + scanningMode: EnumScanningMode.single, + + ///Defines the expected number of barcodes to be scanned. + ///The scanning process will automatically stop when the number of detected barcodes reaches this count. + ///Only available when `scanningMode` is set to `EnumScanningMode.multiple`. Default is 999. + expectedBarcodesCount: 999, + + ///Specifies the maximum number of consecutive stable frames to process before exiting scanning. + ///A "stable frame" is one where no new barcode is detected. + ///Only available when `scanningMode` is set to `EnumScanningMode.multiple`. Default is 10. + maxConsecutiveStableFramesToExit: 10, + + ///Specifies the template configuration for the BarcodeScanner. + ///This can be either a file path or a JSON string that defines various scanning parameters. + ///Default is undefined, which means the default template will be used. + templateFile: "JSON template string", +); +``` + +## Run the Project + +### Camera Permissions + +Before the project can be deployed to a *iOS* device, the camera permissions and the developer signature must first be set. To add the camera permissions to the iOS portion of the app, we recommend first installing the **pods** dependencies to generate the **.xcworkspace** project under the ios folder (`ios/Runner.xcworkspace`). Please run the following commands from the root directory: + +```bash +cd ios/ +pod install --repo-update +``` + +Once the pods are installed, *Runner.xcworkspace* should now be generated in the *ios* folder. To add the camera permissions, open the generated *Runner.xcworkspace* and navigate to the *Info* section of the project settings. Then you must add the "Privacy - Camera Usage Description" key to the list (where you can also assign a string message to show in the alert box). + +> [!NOTE] +> On Android, nothing needs to be done for the camera permissions as they are already defined in the SDK. + +### Deploying to Device + +#### Android + +Go to the project folder, open a new terminal and run the following command: + +```bash +flutter run -d +``` + +You can get the IDs of all connected (physical) devices by running the command `flutter devices`. + +#### iOS + +In order to deploy the app to a iOS device, we recommend doing it via Xcode by using the `Runner.xcworkspace` project that was generated when the pods were installed. Since the camera permissions are taken care of, all you need to do is properly configure the *Signing & Capabilities* section of the project settings. Should the iOS device be connected to the computer, you can now run and deploy the app to the device. + +If everything is set up correctly, you should see the app running on your device. + +## Full Sample Code + +The full sample code is available [here](https://github.com/Dynamsoft/barcode-reader-flutter-samples/tree/main/ScanBarcodes_ReadyToUseComponent). + +## License + +- You can request a 30-day trial license via the [Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=github&package=mobile) portal. + +## Support + +https://www.dynamsoft.com/company/contact/ From f81c72c95c39f01e1277f92d6db6fd637b091f23 Mon Sep 17 00:00:00 2001 From: DMGithubPublisher Date: Thu, 25 Sep 2025 05:10:51 +0800 Subject: [PATCH 2/9] update to internal commit 6f5d7b12 --- programming/flutter/driver-license-user-guide.md | 4 ++-- programming/flutter/foundational-user-guide.md | 10 ++-------- programming/flutter/index.md | 4 ++-- programming/flutter/user-guide.md | 11 +++-------- 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/programming/flutter/driver-license-user-guide.md b/programming/flutter/driver-license-user-guide.md index bd9efc24..4bc0b169 100644 --- a/programming/flutter/driver-license-user-guide.md +++ b/programming/flutter/driver-license-user-guide.md @@ -46,13 +46,13 @@ Support for South African driver licenses is limited - which means that the libr ## Including the Library -1. Run the following command in the root directory of your flutter project to add `dynamsoft_capture_vision_flutter` to the dependencies. +Run the following command in the root directory of your flutter project to add `dynamsoft_capture_vision_flutter` to the dependencies: ```bash flutter pub add dynamsoft_capture_vision_flutter ``` -2. Then run the following command to install all the dependencies: +Then run the following command to install all the dependencies: ```bash flutter pub get diff --git a/programming/flutter/foundational-user-guide.md b/programming/flutter/foundational-user-guide.md index 46505c66..c965bde6 100644 --- a/programming/flutter/foundational-user-guide.md +++ b/programming/flutter/foundational-user-guide.md @@ -14,12 +14,6 @@ This guide will help you develop a barcode scanning app using the [Dynamsoft Cap Dynamsoft Capture Vision (DCV) is an aggregating library for several of Dynamsoft's functional products, including the Dynamsoft Barcode Reader SDK. The [`Capture Vision API`](./api-reference/capture-vision-router-lite/capture-vision-router.md) does not come with a pre-built UI like the BarcodeScanner component (see this [guide](user-guide.md)) - it does provide the user with more parameters to control the barcode reading performance and settings. -## Supported Barcode Symbologies - -| Linear (1D) Barcodes | 2D Barcodes | Others | -| :------------------- | :---------- | :----- | -| Code 39 (including Code 39 Extended)
    Code 93
    Code 128
    Codabar
    Interleaved 2 of 5
    EAN-8
    EAN-13
    UPC-A
    UPC-E
    Industrial 2 of 5







    | QR Code (including Micro QR Code and Model 1)
    Data Matrix
    PDF417 (including Micro PDF417)
    Aztec Code
    MaxiCode (mode 2-5)
    DotCode











    | Patch Code

    GS1 Composite Code

    GS1 DataBar
  • Omnidirectional
  • Truncated, Stacked
  • Stacked Omnidirectional, Limited
  • Expanded, Expanded Stacked

  • Postal Codes
  • USPS Intelligent Mail
  • Postnet
  • Planet
  • Australian Post
  • UK Royal Mail
  • | - ## System Requirements * Latest [Flutter SDK](https://flutter.dev/) @@ -37,13 +31,13 @@ Dynamsoft Capture Vision (DCV) is an aggregating library for several of Dynamsof ## Including the Library -1. Run the following command in the root directory of your flutter project to add `dynamsoft_capture_vision_flutter` to the dependencies +Run the following command in the root directory of your flutter project to add `dynamsoft_capture_vision_flutter` to the dependencies: ```bash flutter pub add dynamsoft_capture_vision_flutter ``` -2. Then run the following command to install all the dependencies: +Then run the following command to install all the dependencies: ```bash flutter pub get diff --git a/programming/flutter/index.md b/programming/flutter/index.md index ba83cc2f..cc93748c 100644 --- a/programming/flutter/index.md +++ b/programming/flutter/index.md @@ -13,8 +13,8 @@ Dynamsoft Barcode Reader (DBR) SDK Flutter Edition is a barcode reading tool des DBR Flutter provides rich API for developers to easily integrate barcode reading functionality into your Flutter applications. When you start the development journey with DBR Flutter, you can choose the **Ready-To-Use Edition** or the **Foundational Edition** - with each providing its own set of benefits. -- **Ready-To-Use Edition**: This edition of the library comes with its own, built-in, sophisticated UI for the camera view. This edition also simplifies the Barcode Reader configuration and focuses on the core configurations of the Barcode Reader. Overall, this edition allows the developer to spend less time worrying about the UI and the extra steps needed to configure the Barcode Reader, but takes away some of the more intricate configurations that can be applied to the Barcode Reader. -- **Foundational Edition**: This edition of the library is built using the foundational Capture Vision API - allowing the user more detailed control over the initialization and configuration of the Barcode Reader. This edition does not come with a built-in UI like the Ready-To-Use Edition, so the UI setup will fall on the developer. However, using the Foundational Edition does open up a larger variety of parameters that can be controlled via the settings (which can still be used in the RTU Edition, but only via a JSON template). +- ***Ready-To-Use Edition***: This edition of the library comes with its own, built-in, sophisticated UI for the camera view. This edition also simplifies the Barcode Reader configuration and focuses on the core configurations of the Barcode Reader. Overall, this edition allows the developer to spend less time worrying about the UI and the extra steps needed to configure the Barcode Reader, but takes away some of the more intricate configurations that can be applied to the Barcode Reader. +- ***Foundational Edition***: This edition of the library is built using the foundational Capture Vision API - allowing the user more detailed control over the initialization and configuration of the Barcode Reader. This edition does not come with a built-in UI like the Ready-To-Use Edition, so the UI setup will fall on the developer. However, using the Foundational Edition does open up a larger variety of parameters that can be controlled via the settings (which can still be used in the RTU Edition, but only via a JSON template). Furthermore, DBR provides a powerful parameter system in order to cope with various scenarios. Read Parameter Reference for details. diff --git a/programming/flutter/user-guide.md b/programming/flutter/user-guide.md index d4bebdb4..8be8ab48 100644 --- a/programming/flutter/user-guide.md +++ b/programming/flutter/user-guide.md @@ -17,12 +17,6 @@ The `BarcodeScanner` is a ready-to-use component that allows developers to quick Even though the UI comes with a default look, the [`BarcodeScanner` API](api-reference/barcode-scanner/barcode-scanner.md) provides the developer with customization options for the UI as well as control over the barcode scanning performance via a set of the basic parameters of barcode decoding that the library offers. -## Supported Barcode Symbologies - -| Linear (1D) Barcodes | 2D Barcodes | Others | -| :------------------- | :---------- | :----- | -| Code 39 (including Code 39 Extended)
    Code 93
    Code 128
    Codabar
    Interleaved 2 of 5
    EAN-8
    EAN-13
    UPC-A
    UPC-E
    Industrial 2 of 5







    | QR Code (including Micro QR Code and Model 1)
    Data Matrix
    PDF417 (including Micro PDF417)
    Aztec Code
    MaxiCode (mode 2-5)
    DotCode











    | Patch Code

    GS1 Composite Code

    GS1 DataBar
  • Omnidirectional
  • Truncated, Stacked
  • Stacked Omnidirectional, Limited
  • Expanded, Expanded Stacked

  • Postal Codes
  • USPS Intelligent Mail
  • Postnet
  • Planet
  • Australian Post
  • UK Royal Mail
  • | - ## Requirements * Latest [Flutter SDK](https://flutter.dev/) @@ -40,13 +34,14 @@ Even though the UI comes with a default look, the [`BarcodeScanner` API](api-ref ## Including the Library -1. Run the following command in the root directory of your flutter project to add `dynamsoft-barcode-reader-bundle-flutter` to the dependencies +Run the following command in the root directory of your flutter project to add `dynamsoft-barcode-reader-bundle-flutter` to the dependencies: ```bash flutter pub add dynamsoft-barcode-reader-bundle-flutter ``` -2. Then run the following command to install all the dependencies: +Then run the following command to install all the dependencies: + ```bash flutter pub get ``` From d16d68e1020b43f0131ced5cae43b23206c50dfc Mon Sep 17 00:00:00 2001 From: DMGithubPublisher Date: Thu, 25 Sep 2025 05:28:56 +0800 Subject: [PATCH 3/9] update to internal commit 0af7d1ce --- _includes/sidelist-programming/programming-android.html | 2 +- _includes/sidelist-programming/programming-maui.html | 2 +- _includes/sidelist-programming/programming-oc.html | 2 +- index.md | 2 +- programming/flutter/driver-license-user-guide.md | 2 +- programming/flutter/foundational-user-guide.md | 2 +- programming/flutter/user-guide.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/_includes/sidelist-programming/programming-android.html b/_includes/sidelist-programming/programming-android.html index 90f9c255..a78718ce 100644 --- a/_includes/sidelist-programming/programming-android.html +++ b/_includes/sidelist-programming/programming-android.html @@ -691,4 +691,4 @@
  • Develop for iOS (Objective-C & Swift)
  • Develop for MAUI
  • Develop for React Native
  • -
  • Develop for Flutter
  • +
  • Develop for Flutter
  • diff --git a/_includes/sidelist-programming/programming-maui.html b/_includes/sidelist-programming/programming-maui.html index 18c0ad22..e673384b 100644 --- a/_includes/sidelist-programming/programming-maui.html +++ b/_includes/sidelist-programming/programming-maui.html @@ -549,4 +549,4 @@
  • Develop for Android (Java & Kotlin)
  • Develop for iOS (Objective-C & Swift)
  • Develop for React Native
  • -
  • Develop for Flutter
  • +
  • Develop for Flutter
  • diff --git a/_includes/sidelist-programming/programming-oc.html b/_includes/sidelist-programming/programming-oc.html index 9f4a3a55..c00c543c 100644 --- a/_includes/sidelist-programming/programming-oc.html +++ b/_includes/sidelist-programming/programming-oc.html @@ -690,4 +690,4 @@
  • Develop for Android (Java & Kotlin)
  • Develop for MAUI
  • Develop for React Native
  • -
  • Develop for Flutter
  • +
  • Develop for Flutter
  • diff --git a/index.md b/index.md index 710ccb71..feb69a2f 100644 --- a/index.md +++ b/index.md @@ -14,7 +14,7 @@ description: Dynamsoft Barcode Reader Mobile SDK Documentation Homepage - ![Android Icon]({{site.assets}}img-icon/homepage/Android.svg){:class="android"} [Android]({{ site.android }}){:target="_blank"} - ![MAUI Icon]({{site.assets}}img-icon/homepage/MAUI.svg){:class="maui"} [MAUI]({{ site.dbr_maui }}){:target="_blank"} - ![Flutter Icon]({{site.assets}}img-icon/homepage/Flutter.svg){:class="flutter"} [Flutter]({{ site.dbr_flutter }}){:target="_blank"} -- +
    - ![React Native Icon]({{site.assets}}img-icon/homepage/React Native.svg){:class="react"} [React Native](https://www.dynamsoft.com/capture-vision/docs/programming/react-native/){:target="_blank"} diff --git a/programming/flutter/driver-license-user-guide.md b/programming/flutter/driver-license-user-guide.md index 4bc0b169..b4971f65 100644 --- a/programming/flutter/driver-license-user-guide.md +++ b/programming/flutter/driver-license-user-guide.md @@ -349,7 +349,7 @@ The full sample code is available [here](./ScanDriversLicense). ## License -- You can request a 30-day trial license via the [Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=github&package=mobile) portal. +You can request a 30-day trial license via the [Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=github&package=mobile) portal. ## Support diff --git a/programming/flutter/foundational-user-guide.md b/programming/flutter/foundational-user-guide.md index c965bde6..a3d7a4ef 100644 --- a/programming/flutter/foundational-user-guide.md +++ b/programming/flutter/foundational-user-guide.md @@ -278,7 +278,7 @@ The full sample code is available [here](https://github.com/Dynamsoft/barcode-re ## License -- You can request a 30-day trial license via the [Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=github&package=mobile) portal. +You can request a 30-day trial license via the [Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=github&package=mobile) portal. ## Support diff --git a/programming/flutter/user-guide.md b/programming/flutter/user-guide.md index 8be8ab48..1d1c4bd2 100644 --- a/programming/flutter/user-guide.md +++ b/programming/flutter/user-guide.md @@ -277,7 +277,7 @@ The full sample code is available [here](https://github.com/Dynamsoft/barcode-re ## License -- You can request a 30-day trial license via the [Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=github&package=mobile) portal. +You can request a 30-day trial license via the [Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=github&package=mobile) portal. ## Support From 4617d43d37a5f8be0403f2af9594b088759206fd Mon Sep 17 00:00:00 2001 From: DMGithubPublisher Date: Fri, 26 Sep 2025 04:20:13 +0800 Subject: [PATCH 4/9] update to internal commit 94b73c05 --- .../programming-flutter.html | 8 +++- .../barcode-scanner/barcode-scan-result.md | 6 ++- .../api-reference/barcode-scanner/index.md | 41 +++++++++++++++++++ .../camera-enhancer.md | 2 +- .../capture-vision-router.md | 2 +- .../captured-result-receiver.md | 10 ++--- .../captured-result.md | 2 +- .../decoded-barcodes-result.md | 2 +- .../license-manager.md | 2 +- .../simplified-barcode-reader-settings.md | 2 +- .../simplified-capture-vision-settings.md | 2 +- programming/flutter/api-reference/index.md | 11 ++--- programming/flutter/user-guide.md | 3 ++ 13 files changed, 71 insertions(+), 22 deletions(-) create mode 100644 programming/flutter/api-reference/barcode-scanner/index.md diff --git a/_includes/sidelist-programming/programming-flutter.html b/_includes/sidelist-programming/programming-flutter.html index e7f5da0d..3f360cb1 100644 --- a/_includes/sidelist-programming/programming-flutter.html +++ b/_includes/sidelist-programming/programming-flutter.html @@ -9,7 +9,7 @@
  • Demo & Samples
  • -
  • BarcodeScanner API +
  • BarcodeScanner API diff --git a/programming/flutter/api-reference/barcode-scanner/barcode-scan-result.md b/programming/flutter/api-reference/barcode-scanner/barcode-scan-result.md index 36d35872..77eb5dfc 100644 --- a/programming/flutter/api-reference/barcode-scanner/barcode-scan-result.md +++ b/programming/flutter/api-reference/barcode-scanner/barcode-scan-result.md @@ -25,7 +25,7 @@ class BarcodeScanResult | Property | Type | Description | | -------- | ---- | ----------- | -| [`barcodes`](#barcodes) | [*List*](../barcode-result-item.md) | Represents all the decoded barcodes in an array of [`BarcodeResultItem`](../barcode-result-item.md). | +| [`barcodes`](#barcodes) | *List* | Represents all the decoded barcodes in an array of [`BarcodeResultItem`](../barcode-result-item.md). | | [`status`](#status) | [*EnumResultStatus*](../enum/result-status.md) | Represents the result status, which can be finished, canceled or exception. | | [`errorCode`](#errorcode) | *int* | Represents the error code should something go wrong during the barcode scanning process. | | [`errorString`](#errorstring) | *string* | Represents the error message associated with the error code should something go wrong during the barcode scanning process. | @@ -50,9 +50,11 @@ Represents the status of the result, which can be finished, canceled or exceptio EnumResultStatus resultStatus; ``` +**Remarks** + - `EnumResultStatus.finished`: The barcode scanning is finished. - `EnumResultStatus.canceled`: The barcode scanning activity is closed before the process is finished. -- `EnumResultStatus.exception`: Failed to start barcode scanning or an error occurs when scanning the barcode. +- `EnumResultStatus.exception`: Failed to start barcode scanning or an error occurs during the scanning process. ### errorCode diff --git a/programming/flutter/api-reference/barcode-scanner/index.md b/programming/flutter/api-reference/barcode-scanner/index.md new file mode 100644 index 00000000..8ed7ec79 --- /dev/null +++ b/programming/flutter/api-reference/barcode-scanner/index.md @@ -0,0 +1,41 @@ +--- +layout: default-layout +title: Dynamsoft Barcode Reader Flutter API Reference - BarcodeScanner API Main Page +description: This is the main page of the BarcodeScanner (Ready-To-Use) API for Flutter. +keywords: api reference, Flutter, barcode reader, ready to use, +needAutoGenerateSidebar: true +noTitleIndex: true +needGenerateH3Content: true +--- + +# BarcodeScanner (Ready-To-Use) API Reference + +As mentioned in the Introduction page, the Barcode Reader can be implemented either via a set of *Ready-To-Use API* or the *Capture Vision Foundational API*. Each has its own draws and benefits, so even though the Ready-To-Use Edition is sufficient for most cases, it is careful to consider which edition your usage scenario requires. + +The BarcodeScanner class is built on top of the Capture Vision Foundational API to offer a faster and smoother development experience, providing a more sophisticated UI while not sacrificing any performance aspect of the library. + +> [!NOTE] +> In order to use the BarcodeScanner class, you must include *dynamsoft_barcode_reader_bundle_flutter* in the project dependencies. +> Please note that *dynamsoft_barcode_reader_bundle_flutter* is dependent on *dynamsoft_capture_vision_flutter*. Including the *dynamsoft_barcode_reader_bundle_flutter* library will automatically include the *dynamsoft_capture_vision_flutter* library. + + +## API Overview + +### BarcodeScanner + +[`BarcodeScanner`](barcode-scanner.md) is the main class of the Ready-to-Use edition of the library and contains the API needed to implement the barcode scanning functionality. Please visit the BarcodeScanner Class page to learn about how this class operates. + +> [!TIP] +> To learn how to implement the Barcode Reader using the BarcodeScanner API, please read through the [Barcode Reader Integration Guide (Ready-To-Use Edition)](../user-guide.md). + +### BarcodeScannerConfig + +[`BarcodeScannerConfig`](barcode-scanner-config.md) is the class that defines the configurations for the Barcode Scanner. These configurations can be from a performance related or UI related. Even though the full set of parameters of the Barcode Reader is not exposed in this class, they can still be set via a JSON template - allowing the developer to fully customize the Barcode Reader's performance while still making use of the benefits of the Ready-To-Use API. + +> [!TIP] +> To learn how to configure the BarcodeScanner instance using the BarcodeScannerConfig class, please visit this [section of the Ready-To-Use Guide](../../user-guide.md#configuring-the-barcodescanner-optional). + +### BarcodeScanResult + +[`BarcodeScanResult`](barcode-scan-result.md) is a result class that contains all the decoded barcodes and their associated info. This class is dependent on the [`BarcodeResultItem`](../barcode-result-item.md) class which is part of the Capture Vision Foundational API. + diff --git a/programming/flutter/api-reference/capture-vision-router-lite/camera-enhancer.md b/programming/flutter/api-reference/capture-vision-router-lite/camera-enhancer.md index 91a33c7f..0bf03386 100644 --- a/programming/flutter/api-reference/capture-vision-router-lite/camera-enhancer.md +++ b/programming/flutter/api-reference/capture-vision-router-lite/camera-enhancer.md @@ -1,6 +1,6 @@ --- layout: default-layout -title: CameraEnhancer Class - Dynamsoft Capture Vision Router Lite Flutter +title: CameraEnhancer Class - Dynamsoft Capture Vision Flutter description: CameraEnhancer class of DCV Flutter edition manages camera operations and enhancements. keywords: camera, enhancer, barcode reader, flutter, capture vision needGenerateH3Content: true diff --git a/programming/flutter/api-reference/capture-vision-router-lite/capture-vision-router.md b/programming/flutter/api-reference/capture-vision-router-lite/capture-vision-router.md index 8002e458..0067a92c 100644 --- a/programming/flutter/api-reference/capture-vision-router-lite/capture-vision-router.md +++ b/programming/flutter/api-reference/capture-vision-router-lite/capture-vision-router.md @@ -1,6 +1,6 @@ --- layout: default-layout -title: CaptureVisionRouter - Dynamsoft Capture Vision Router Lite Flutter +title: CaptureVisionRouter - Dynamsoft Capture Vision Flutter description: CaptureVisionRouter class of Dynamsoft Capture Vision Router contains all of the core methods to use Dynamsoft Capture Vision. keywords: CaptureVisionRouter, Barcode Reader, capture, flutter, foundational needGenerateH3Content: true diff --git a/programming/flutter/api-reference/capture-vision-router-lite/captured-result-receiver.md b/programming/flutter/api-reference/capture-vision-router-lite/captured-result-receiver.md index 3e359082..51816097 100644 --- a/programming/flutter/api-reference/capture-vision-router-lite/captured-result-receiver.md +++ b/programming/flutter/api-reference/capture-vision-router-lite/captured-result-receiver.md @@ -1,6 +1,6 @@ --- layout: default-layout -title: CapturedResultReceiver Interface - Dynamsoft Capture Vision Router Lite Flutter +title: CapturedResultReceiver Interface - Dynamsoft Capture Vision Flutter description: CapturedResultReceiver interface of DCV Flutter edition is designed as a standardized way for retrieving captured results. keywords: decoded barcodes, parsed results, captured results, CRR, result receiver, output, flutter, barcode reader needGenerateH3Content: true @@ -24,10 +24,10 @@ class CapturedResultReceiver | Method | Description | | ------ | ----------- | -| [`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. | +| [`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. | -### OnCapturedResultReceived +### onCapturedResultReceived This callback method delivers a [`CapturedResult`](captured-result.md) - an object representing any kind of captured result item that is captured 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. @@ -39,7 +39,7 @@ Future Function(CapturedResult result)? onCapturedResultReceived; `result`: The captured result, an instance of [`CapturedResult`](captured-result.md). -### OnDecodedBarcodesReceived +### onDecodedBarcodesReceived This callback method delivers a [`DecodedBarcodesResult`](decoded-barcodes-result.md), which is an object representing any captured result of type `CRIT_BARCODE` 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. diff --git a/programming/flutter/api-reference/capture-vision-router-lite/captured-result.md b/programming/flutter/api-reference/capture-vision-router-lite/captured-result.md index 73785495..43b67e4e 100644 --- a/programming/flutter/api-reference/capture-vision-router-lite/captured-result.md +++ b/programming/flutter/api-reference/capture-vision-router-lite/captured-result.md @@ -1,6 +1,6 @@ --- layout: default-layout -title: CapturedResult Class - Dynamsoft Capture Vision Router Lite Flutter +title: CapturedResult Class - Dynamsoft Capture Vision Flutter description: CapturedResult class of DCV Flutter edition represents the result of a capture operation on an image. keywords: decoded barcode, parsed result, error code, output, captured result, flutter, barcode reader needGenerateH3Content: true diff --git a/programming/flutter/api-reference/capture-vision-router-lite/decoded-barcodes-result.md b/programming/flutter/api-reference/capture-vision-router-lite/decoded-barcodes-result.md index d9f9f821..77cde8f4 100644 --- a/programming/flutter/api-reference/capture-vision-router-lite/decoded-barcodes-result.md +++ b/programming/flutter/api-reference/capture-vision-router-lite/decoded-barcodes-result.md @@ -1,6 +1,6 @@ --- layout: default-layout -title: DecodedBarcodesResult Class - Dynamsoft Barcode Reader Flutter Edition +title: DecodedBarcodesResult Class - Dynamsoft Capture Vision Flutter Edition description: The DecodedBarcodesResult class represents the result of a barcode reading process. It provides access to information about the decoded barcodes, the source image, and any errors that occurred during the barcode reading process. keywords: GetOriginalImageHashId, GetItemsCount, GetErrorCode, DecodedBarcodesResult, api reference, barcode result, capture, flutter needAutoGenerateSidebar: true diff --git a/programming/flutter/api-reference/capture-vision-router-lite/license-manager.md b/programming/flutter/api-reference/capture-vision-router-lite/license-manager.md index 09984d8c..a4810792 100644 --- a/programming/flutter/api-reference/capture-vision-router-lite/license-manager.md +++ b/programming/flutter/api-reference/capture-vision-router-lite/license-manager.md @@ -1,6 +1,6 @@ --- layout: default-layout -title: LicenseManager Class - Dynamsoft Capture Vision Router Lite Flutter +title: LicenseManager Class - Dynamsoft Capture Vision Flutter description: LicenseManager class of DCV Flutter provides API to initialize and verify product licenses. keywords: license, manager, barcode reader, flutter, capture vision needGenerateH3Content: true diff --git a/programming/flutter/api-reference/capture-vision-router-lite/simplified-barcode-reader-settings.md b/programming/flutter/api-reference/capture-vision-router-lite/simplified-barcode-reader-settings.md index f0b6d7af..108e5ba0 100644 --- a/programming/flutter/api-reference/capture-vision-router-lite/simplified-barcode-reader-settings.md +++ b/programming/flutter/api-reference/capture-vision-router-lite/simplified-barcode-reader-settings.md @@ -1,6 +1,6 @@ --- layout: default-layout -title: SimplifiedBarcodeReaderSettings Class - Dynamsoft Barcode Reader Flutter Edition +title: SimplifiedBarcodeReaderSettings Class - Dynamsoft Capture Vision Flutter Edition description: SimplifiedBarcodeReaderSettings class contains settings for barcode decoding. It is a sub-parameter of SimplifiedCaptureVisionSettings keywords: SimplifiedBarcodeReaderSettings, SimplifiedCaptureVisionSettings, inverted barcode, Deblur, localization, expected barcodes count, barcode format, confidence, RegEx pattern, flutter needAutoGenerateSidebar: true diff --git a/programming/flutter/api-reference/capture-vision-router-lite/simplified-capture-vision-settings.md b/programming/flutter/api-reference/capture-vision-router-lite/simplified-capture-vision-settings.md index 74169318..ec0a0a6f 100644 --- a/programming/flutter/api-reference/capture-vision-router-lite/simplified-capture-vision-settings.md +++ b/programming/flutter/api-reference/capture-vision-router-lite/simplified-capture-vision-settings.md @@ -1,6 +1,6 @@ --- layout: default-layout -title: SimplifiedCaptureVisionSettings Class - Dynamsoft Capture Vision Router Lite Flutter +title: SimplifiedCaptureVisionSettings Class - Dynamsoft Capture Vision Flutter description: SimplifiedCaptureVisionSettings class of DCV Flutter edition provides settings for capturing and recognizing images with the CaptureVisionRouter class. keywords: roi, result item type, min interval, timeout, flutter, settings, foundational needGenerateH3Content: true diff --git a/programming/flutter/api-reference/index.md b/programming/flutter/api-reference/index.md index e5ba36e5..81d15850 100644 --- a/programming/flutter/api-reference/index.md +++ b/programming/flutter/api-reference/index.md @@ -8,13 +8,13 @@ noTitleIndex: true needGenerateH3Content: true --- -# SDK Overview: Modules and Main APIs +# Capture Vision SDK Overview: Modules and Main APIs -This page provides an overview of the various modules and highlights the most essential APIs that form the backbone of Dynamsoft Barcode Reader SDKs. +This page provides an overview of the various modules and highlights the most essential APIs that form Dynamsoft Capture Vision, the backbone of Dynamsoft Barcode Reader SDKs. ## Modules Summary -**dynamsoft_capture_vision_flutter** represents the Dynamsoft Capture Vision library - parent library that contains the foundational classes and methods for not only the Barcode Reader, but the other functional Dynamsoft products such as the Dynamsoft Label Recognizer and the Dynamsoft Document Normalizer. +**dynamsoft_capture_vision_flutter** represents the Dynamsoft Capture Vision library - the xparent library that contains the foundational classes and methods for not only the Barcode Reader, but the other functional Dynamsoft products such as the Dynamsoft Label Recognizer and the Dynamsoft Document Normalizer. **dynamsoft_barcode_reader_bundle_flutter** is built on the Dynamsoft Capture Vision (DCV) framework, which includes multiple modules working together to achieve the full barcode reading functionality. This library gives the developer access to the `BarcodeScanner` class, a **ready-to-use barcode reader** that requires minimal effort and configuration and comes with a sophisticated and user-friendly UI. @@ -25,9 +25,6 @@ The hierarchical structure diagram below illustrates the various modules of the

    Modules hierarchical of the DBR SDK

    -> [!NOTE] -> Please note that *dynamsoft_barcode_reader_bundle_flutter* is dependent on *dynamsoft_capture_vision_flutter*. Including the *dynamsoft_barcode_reader_bundle_flutter* library will automatically include the *dynamsoft_capture_vision_flutter* library. - + diff --git a/programming/flutter/api-reference/capture-vision-router-lite/captured-result-receiver.md b/programming/flutter/api-reference/capture-vision-router-lite/captured-result-receiver.md index 51816097..52eb5545 100644 --- a/programming/flutter/api-reference/capture-vision-router-lite/captured-result-receiver.md +++ b/programming/flutter/api-reference/capture-vision-router-lite/captured-result-receiver.md @@ -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 @@ -50,3 +51,11 @@ Future 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 Function(ParsedResult result)? onParsedResultsReceived; +``` diff --git a/programming/flutter/api-reference/capture-vision-router-lite/torch-button.md b/programming/flutter/api-reference/capture-vision-router-lite/torch-button.md new file mode 100644 index 00000000..e424a1d0 --- /dev/null +++ b/programming/flutter/api-reference/capture-vision-router-lite/torch-button.md @@ -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' +); +``` diff --git a/programming/flutter/api-reference/enum/barcode-format.md b/programming/flutter/api-reference/enum/barcode-format.md index 133fc5a7..6526f7fa 100644 --- a/programming/flutter/api-reference/enum/barcode-format.md +++ b/programming/flutter/api-reference/enum/barcode-format.md @@ -19,37 +19,37 @@ breadcrumbText: EnumBarcodeFormat ```dart enum EnumBarcodeFormat { - /** No barcode format specified.*/ + /** No barcode format specified.**/ none, - /** Represents all supported barcode formats. Useful for scanning operations where any type of barcode is acceptable. */ + /** Represents all supported barcode formats. Useful for scanning operations where any type of barcode is acceptable. **/ all, - /** Default barcode formats that are commonly used. This is a subset of `all` tailored for general use. */ + /** Default barcode formats that are commonly used. This is a subset of `all` tailored for general use. **/ defaultFormat, - /** One-dimensional barcode formats, including BF_CODE_39, BF_CODE_128, BF_CODE_93, BF_CODABAR, BF_ITF, BF_EAN_13, BF_EAN_8, BF_UPC_A, BF_UPC_E, INDUSTRIAL_25, BF_CODE_39_Extended and BF_MSI_CODE. */ + /** One-dimensional barcode formats, including BF_CODE_39, BF_CODE_128, BF_CODE_93, BF_CODABAR, BF_ITF, BF_EAN_13, BF_EAN_8, BF_UPC_A, BF_UPC_E, INDUSTRIAL_25, BF_CODE_39_Extended and BF_MSI_CODE. **/ oned, - /** Code 39 format, widely used in various industries for inventory and manufacturing. */ + /** Code 39 format, widely used in various industries for inventory and manufacturing. **/ code39, - /** Code 128 format, a high-density barcode for alphanumeric or numeric-only data. */ + /** Code 128 format, a high-density barcode for alphanumeric or numeric-only data. **/ code128, - /** Code 93 format, similar to Code 39 but more compact and secure with support for the full ASCII character set. */ + /** Code 93 format, similar to Code 39 but more compact and secure with support for the full ASCII character set. **/ code93, - /** Codabar format, used for various numeric barcodes in libraries, blood banks, and parcels. */ + /** Codabar format, used for various numeric barcodes in libraries, blood banks, and parcels. **/ codabar, - /** Interleaved 2 of 5 format, a numeric-only barcode used in warehousing, distribution, and logistics. */ + /** Interleaved 2 of 5 format, a numeric-only barcode used in warehousing, distribution, and logistics. **/ itf, - /** EAN-13 format, a superset of the UPC-A barcode used worldwide for marking retail goods. */ + /** EAN-13 format, a superset of the UPC-A barcode used worldwide for marking retail goods. **/ ean13, - /** EAN-8 format, a compressed version of EAN-13 for smaller packages. */ + /** EAN-8 format, a compressed version of EAN-13 for smaller packages. **/ ean8, - /** UPC-A format, widely used in the United States and Canada for tracking trade items in stores. */ + /** UPC-A format, widely used in the United States and Canada for tracking trade items in stores. **/ upcA, - /** UPC-E format, a smaller version of the UPC-A barcode used for smaller packages. */ + /** UPC-E format, a smaller version of the UPC-A barcode used for smaller packages. **/ upcE, - /** Industrial 2 of 5 format, an older, numeric-only barcode used in the industrial sector. */ + /** Industrial 2 of 5 format, an older, numeric-only barcode used in the industrial sector. **/ industrial25, - /** Extended Code 39 format, capable of encoding the full ASCII character set by combining standard Code 39 characters. */ + /** Extended Code 39 format, capable of encoding the full ASCII character set by combining standard Code 39 characters. **/ code39Extended, - /** GS1 DataBar barcode formats, including BF_GS1_DATABAR_OMNIDIRECTIONAL, BF_GS1_DATABAR_TRUNCATED, BF_GS1_DATABAR_STACKED, BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL, BF_GS1_DATABAR_EXPANDED, BF_GS1_DATABAR_EXPANDED_STACKED, BF_GS1_DATABAR_LIMITED. These barcodes are designed for use in retail and healthcare for fresh foods and small items. */ + /** GS1 DataBar barcode formats, including BF_GS1_DATABAR_OMNIDIRECTIONAL, BF_GS1_DATABAR_TRUNCATED, BF_GS1_DATABAR_STACKED, BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL, BF_GS1_DATABAR_EXPANDED, BF_GS1_DATABAR_EXPANDED_STACKED, BF_GS1_DATABAR_LIMITED. These barcodes are designed for use in retail and healthcare for fresh foods and small items. **/ gs1Databar, gs1DatabarStackedOmnidirectional, gs1DatabarTruncated, @@ -58,63 +58,63 @@ enum EnumBarcodeFormat gs1DatabarExpanded, gs1DatabarExpandedStacked, gs1DatabarLimited, - /** Patch code, a special barcode used for document scanning applications to separate batches of documents. */ + /** Patch code, a special barcode used for document scanning applications to separate batches of documents. **/ patchcode, - /** Micro PDF417, a compact version of PDF417 used for applications where space is limited. */ + /** Micro PDF417, a compact version of PDF417 used for applications where space is limited. **/ microPdf417, - /** MSI Code, a barcode used in inventory and warehouse to encode information in the distribution of goods. */ + /** MSI Code, a barcode used in inventory and warehouse to encode information in the distribution of goods. **/ msiCode, - /** Code 11, used primarily for labeling telecommunications equipment. */ + /** Code 11, used primarily for labeling telecommunications equipment. **/ code11, - /** Two-Digit Add-On, an extension to UPC and EAN codes for magazines and books. */ + /** Two-Digit Add-On, an extension to UPC and EAN codes for magazines and books. **/ twoDigitAddOn, - /** Five-Digit Add-On, used with UPC and EAN codes for additional data, such as suggested retail price. */ + /** Five-Digit Add-On, used with UPC and EAN codes for additional data, such as suggested retail price. **/ fiveDigitAddOn, - /** Code 32, also known as Italian PharmaCode, used specifically in the Italian pharmaceutical industry. */ + /** Code 32, also known as Italian PharmaCode, used specifically in the Italian pharmaceutical industry. **/ code32, - /** PDF417, a two-dimensional barcode used in a variety of applications, capable of encoding large amounts of data. */ + /** PDF417, a two-dimensional barcode used in a variety of applications, capable of encoding large amounts of data. **/ pdf417, - /** QR Code, a widely used two-dimensional barcode with high data capacity and error correction capability. */ + /** QR Code, a widely used two-dimensional barcode with high data capacity and error correction capability. **/ qrCode, - /** DataMatrix, a two-dimensional barcode used for marking small items, providing high data density and reliability. */ + /** DataMatrix, a two-dimensional barcode used for marking small items, providing high data density and reliability. **/ datamatrix, - /** Aztec, a two-dimensional barcode known for its compact size and suitability for encoding small amounts of data efficiently. */ + /** Aztec, a two-dimensional barcode known for its compact size and suitability for encoding small amounts of data efficiently. **/ aztec, - /** MaxiCode, a two-dimensional barcode used primarily for parcel and package tracking in logistics and postal services. */ + /** MaxiCode, a two-dimensional barcode used primarily for parcel and package tracking in logistics and postal services. **/ maxicode, - /** Micro QR, a smaller version of the QR Code designed for applications where space is limited. */ + /** Micro QR, a smaller version of the QR Code designed for applications where space is limited. **/ microQr, - /** GS1 Composite, a group of barcodes used in conjunction with GS1 DataBar or linear barcodes to provide additional information. */ + /** GS1 Composite, a group of barcodes used in conjunction with GS1 DataBar or linear barcodes to provide additional information. **/ gs1Composite, - /** Nonstandard barcode, a placeholder for barcodes that do not conform to established industry standards. */ + /** Nonstandard barcode, a placeholder for barcodes that do not conform to established industry standards. **/ nonStandardBarcode, - /** DotCode, a two-dimensional barcode designed for high-speed printing applications. */ + /** DotCode, a two-dimensional barcode designed for high-speed printing applications. **/ dotcode, - /** PharmaCode, a general category that includes both BF_PHARMACODE_ONE_TRACK and BF_PHARMACODE_TWO_TRACK. */ + /** PharmaCode, a general category that includes both BF_PHARMACODE_ONE_TRACK and BF_PHARMACODE_TWO_TRACK. **/ pharmacode, - /** PharmaCode One Track, used in the pharmaceutical industry for packaging control. */ + /** PharmaCode One Track, used in the pharmaceutical industry for packaging control. **/ pharmacodeOneTrack, - /** PharmaCode Two Track, an extension of PharmaCode for encoding additional data. */ + /** PharmaCode Two Track, an extension of PharmaCode for encoding additional data. **/ pharmacodeTwoTrack, - /** Matrix 2 of 5, an older form of barcode used in warehouse sorting and conveyor systems. */ + /** Matrix 2 of 5, an older form of barcode used in warehouse sorting and conveyor systems. **/ matrix25, - /**Combined value of BF2_USPSINTELLIGENTMAIL, BF2_POSTNET, BF2_PLANET, BF2_AUSTRALIANPOST, BF2_RM4SCC, BF_KIX.*/ + /**Combined value of BF2_USPSINTELLIGENTMAIL, BF2_POSTNET, BF2_PLANET, BF2_AUSTRALIANPOST, BF2_RM4SCC, BF_KIX.**/ postalCode, - /** USPS Intelligent Mail, a barcode used by the United States Postal Service to provide greater information and tracking capabilities. */ + /** USPS Intelligent Mail, a barcode used by the United States Postal Service to provide greater information and tracking capabilities. **/ uspsIntelligentMail, - /** Postnet, used by the USPS for automating the sorting of mail. */ + /** Postnet, used by the USPS for automating the sorting of mail. **/ postnet, - /** Planet, another USPS barcode, similar to Postnet, but with additional data capacity. */ + /** Planet, another USPS barcode, similar to Postnet, but with additional data capacity. **/ planet, - /** Australian Post, barcodes used by the Australian postal service for mail sorting. */ + /** Australian Post, barcodes used by the Australian postal service for mail sorting. **/ australianPost, - /** RM4SCC (Royal Mail 4 State Customer Code), used by the UK's Royal Mail for automated mail sorting. */ + /** RM4SCC (Royal Mail 4 State Customer Code), used by the UK's Royal Mail for automated mail sorting. **/ rm4scc, - /** KIX (Klant index - Customer index), used by the Dutch postal service for sorting mail. */ + /** KIX (Klant index - Customer index), used by the Dutch postal service for sorting mail. **/ kix, - /**Telepen*/ + /**Telepen**/ telepen, - /**Telepen Numeric. A variation of the Telepen format optimized for encoding numeric data only.*/ + /**Telepen Numeric. A variation of the Telepen format optimized for encoding numeric data only.**/ telepenNumeric } ``` diff --git a/programming/flutter/api-reference/enum/camera-position.md b/programming/flutter/api-reference/enum/camera-position.md new file mode 100644 index 00000000..d485e9d1 --- /dev/null +++ b/programming/flutter/api-reference/enum/camera-position.md @@ -0,0 +1,31 @@ +--- +layout: default-layout +title: EnumCameraPosition - Dynamsoft Barcode Reader Flutter +description: Enumeration EnumCameraPosition of DBR Flutter Edition defines the possible camera(s) to choose from. +keywords: camera enhancer, position, flutter, barcode +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: EnumCameraPosition +--- + +# EnumCameraPosition + +`EnumCameraPosition` is an enumeration that defines the possible camera positions that are available to a device. The majority of modern mobile devices have a front and a rear camera. The more recent iPhones also come with multiple rear cameras, each being suited to different scenarios. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +enum EnumCameraPosition +{ + /** The default, back-facing camera. It is a wide-angle camera for general usage. **/ + back, + /** The front-facing camera. **/ + front, + /** The back-facing ultra-wide-angle camera - which should be used for macro-distance scenarios. (iOS ONLY) **/ + backUltraWide, + /** The back-facing virtual camera that can automatically switch between the default wide-angle and the ultra-wide-angle cameras. Supported devices include: iPhone 13 Pro, iPhone 13 Pro Max, iPhone 14 Pro, iPhone 14 Pro Max, iPhone 15 Pro, iPhone 15 Pro Max. **/ + backDualWideAuto +} +``` diff --git a/programming/flutter/api-reference/enum/captured-result-item-type.md b/programming/flutter/api-reference/enum/captured-result-item-type.md index c22082d1..064d102a 100644 --- a/programming/flutter/api-reference/enum/captured-result-item-type.md +++ b/programming/flutter/api-reference/enum/captured-result-item-type.md @@ -22,11 +22,11 @@ breadcrumbText: EnumCapturedResultItemType ```dart enum EnumCapturedResultItemType { - /** The original image on which the capture process was performed. This result type can be output by any of the Capture Vision functional products (Barcode Reader, Label Recognizer, and Document Normalizer) */ + /** The original image on which the capture process was performed. This result type can be output by any of the Capture Vision functional products (Barcode Reader, Label Recognizer, and Document Normalizer) **/ originalImage, - /** The decoded barcode, which is the result at the end of a Barcode Reader task. */ + /** The decoded barcode, which is the result at the end of a Barcode Reader task. **/ barcode, - /** The parsed result, which is the result at the end of a Code Parser task. */ + /** The parsed result, which is the result at the end of a Code Parser task. **/ parsedResult } ``` diff --git a/programming/flutter/api-reference/enum/deblur-mode.md b/programming/flutter/api-reference/enum/deblur-mode.md index 131174a0..0cfbc6e6 100644 --- a/programming/flutter/api-reference/enum/deblur-mode.md +++ b/programming/flutter/api-reference/enum/deblur-mode.md @@ -19,29 +19,29 @@ breadcrumbText: EnumDeblurMode ```dart enum EnumDeblurMode { - /** Skips the process, no deblurring is applied. */ + /** Skips the process, no deblurring is applied. **/ skip, - /** Applies a direct binarization algorithm for generating the binary image. */ + /** Applies a direct binarization algorithm for generating the binary image. **/ directBinarization, - /** Utilizes a threshold binarization algorithm for generating the binary image, dynamically determining the threshold based on the image content. */ + /** Utilizes a threshold binarization algorithm for generating the binary image, dynamically determining the threshold based on the image content. **/ thresholdBinarization, - /** Employs a gray equalization algorithm to adjust the contrast and brightness, improving the clarity of the gray-scale image before binarization. */ + /** Employs a gray equalization algorithm to adjust the contrast and brightness, improving the clarity of the gray-scale image before binarization. **/ grayEqualization, - /** Implements a smoothing algorithm to reduce noise and artifacts, smoothing out the gray-scale image before binarization. */ + /** Implements a smoothing algorithm to reduce noise and artifacts, smoothing out the gray-scale image before binarization. **/ smoothing, - /** Uses a morphing algorithm to enhance the gray-scale image before binarization. */ + /** Uses a morphing algorithm to enhance the gray-scale image before binarization. **/ morphing, - /** Engages in a deep analysis of the grayscale image based on the barcode format to intelligently generate the optimized binary image, tailored to complex or severely blurred images. */ + /** Engages in a deep analysis of the grayscale image based on the barcode format to intelligently generate the optimized binary image, tailored to complex or severely blurred images. **/ deepAnalysis, - /** Applies a sharpening algorithm to enhance the edges and details of the barcode, making it more distinguishable on the gray-scale image before binarization. */ + /** Applies a sharpening algorithm to enhance the edges and details of the barcode, making it more distinguishable on the gray-scale image before binarization. **/ sharpening, - /** Decodes the barcodes based on the binary image obtained during the localization process. */ + /** Decodes the barcodes based on the binary image obtained during the localization process. **/ basedOnLocBin, - /** Combines sharpening and smoothing algorithms for a comprehensive deblurring effect, targeting both clarity and smoothness of the gray-scale image before binarization. */ + /** Combines sharpening and smoothing algorithms for a comprehensive deblurring effect, targeting both clarity and smoothness of the gray-scale image before binarization. **/ sharpeningSmoothing, - /** Use the deep learning algorithm to recognize the barcodes. */ + /** Use the deep learning algorithm to recognize the barcodes. **/ neuralNetwork, - /**Placeholder value with no functional meaning. */ + /**Placeholder value with no functional meaning. **/ end } ``` diff --git a/programming/flutter/api-reference/enum/drawing-layer-id.md b/programming/flutter/api-reference/enum/drawing-layer-id.md new file mode 100644 index 00000000..4fc9ff09 --- /dev/null +++ b/programming/flutter/api-reference/enum/drawing-layer-id.md @@ -0,0 +1,31 @@ +--- +layout: default-layout +title: EnumDrawingLayerId - Dynamsoft Barcode Reader Flutter +description: Enumeration EnumDrawingLayerId of DBR Flutter Edition defines the different drawing layers that the CameraView provides. +keywords: drawing layer, Flutter, camera enhancer, UI +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: EnumDrawingLayerId +--- + +# EnumDrawingLayerId + +`EnumDrawingLayerId` is an enumeration that defines the different drawing layers that the CameraView provides. The drawing layer is responsible for creating the highlight boxes around detected barcodes and other captured results. By default, there is a drawing layer assigned to each functional product under Capture Vision. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +enum EnumDrawingLayerId +{ + /** The preset DrawingLayer for the Dynamsoft Document Normalizer **/ + ddn, + /** The preset DrawingLayer for the Dynamsoft Barcode Reader **/ + dbr, + /** The preset DrawingLayer for the Dynamsoft Label Recognizer **/ + dlr, + /** A custom DrawingLayer for tips **/ + tip +} +``` diff --git a/programming/flutter/api-reference/enum/enhanced-features-camera.md b/programming/flutter/api-reference/enum/enhanced-features-camera.md new file mode 100644 index 00000000..e8fdf795 --- /dev/null +++ b/programming/flutter/api-reference/enum/enhanced-features-camera.md @@ -0,0 +1,35 @@ +--- +layout: default-layout +title: EnumEnhancedFeatures - Dynamsoft Barcode Reader Flutter +description: Enumeration EnumEnhancedFeatures of DBR Flutter Edition defines the enhanced features of the Camera Enhancer that can be activated. +keywords: enhanced features, Flutter, camera enhancer, zoom, torch +needAutoGenerateSidebar: true +needGenerateH3Content: true +breadcrumbText: EnumEnhancedFeatures +--- + +# EnumEnhancedFeatures + +`EnumEnhancedFeatures` is an enumeration that defines the set of enhanced features that the Camera Enhancer offers. These enhanced features can help improve the performance of the Barcode Reader or adapt it to certain difficult scenarios e.g. using auto-zoom for barcodes that are farther than normal. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +enum EnumEnhancedFeatures +{ + /** Enables frame filtering to improve image quality, potentially leading to better read rate results. **/ + frameFilter, + /** Allows sensor control to automatically filter out any frames while the device is shaking. **/ + sensorControl, + /** Enhances the camera's focus capabilities, facilitating the camera to trigger auto-focus. This is especially useful for low-end mobile devices that do not have the ability to auto-focus. **/ + enhancedFocus, + /** Causes the camera to zoom in automatically when the barcode that it is trying to capture is far away, making the localization and decoding process easier for the Barcode Reader. **/ + autoZoom, + /** Activates the smart torch feature, which displays a torch button in the camera view when the environment brightness is low and hides the button if the brightness is high. **/ + smartTorch, + /** Enables all of the above enhanced features. **/ + all +} +``` diff --git a/programming/flutter/api-reference/enum/grayscale-enhancement-mode.md b/programming/flutter/api-reference/enum/grayscale-enhancement-mode.md index c88cdb3e..27de2edd 100644 --- a/programming/flutter/api-reference/enum/grayscale-enhancement-mode.md +++ b/programming/flutter/api-reference/enum/grayscale-enhancement-mode.md @@ -19,19 +19,19 @@ breadcrumbText: EnumGrayscaleEnhancementMode ```dart enum EnumGrayscaleEnhancementMode { - /** Disables any grayscale image preprocessing. Selecting this mode skips the preprocessing step, passing the image through to subsequent operations without modification. */ + /** Disables any grayscale image preprocessing. Selecting this mode skips the preprocessing step, passing the image through to subsequent operations without modification. **/ skip, - /** Automatic selection of grayscale enhancement mode which is currently not supported. Future implementations may automatically choose the most suitable enhancement based on image analysis. */ + /** Automatic selection of grayscale enhancement mode which is currently not supported. Future implementations may automatically choose the most suitable enhancement based on image analysis. **/ auto, - /** Uses the original, unprocessed image for subsequent operations. This mode is selected when no specific grayscale enhancement is required, maintaining the image in its natural state. */ + /** Uses the original, unprocessed image for subsequent operations. This mode is selected when no specific grayscale enhancement is required, maintaining the image in its natural state. **/ general, - /** Applies a grayscale equalization algorithm to the image, enhancing contrast and detail in gray level. Suitable for images with poor contrast. */ + /** Applies a grayscale equalization algorithm to the image, enhancing contrast and detail in gray level. Suitable for images with poor contrast. **/ grayEqualize, - /** Implements a grayscale smoothing algorithm to reduce noise and smooth the image. This can be beneficial for images with high levels of grain or noise. */ + /** Implements a grayscale smoothing algorithm to reduce noise and smooth the image. This can be beneficial for images with high levels of grain or noise. **/ graySmooth, - /** Enhances the image by applying both sharpening and smoothing algorithms. This mode aims to increase clarity and detail while reducing noise, offering a balanced approach to image preprocessing. */ + /** Enhances the image by applying both sharpening and smoothing algorithms. This mode aims to increase clarity and detail while reducing noise, offering a balanced approach to image preprocessing. **/ sharpenSmooth, - /** Placeholder value with no functional meaning. */ + /** Placeholder value with no functional meaning. **/ end } ``` diff --git a/programming/flutter/api-reference/enum/grayscale-transformation-mode.md b/programming/flutter/api-reference/enum/grayscale-transformation-mode.md index 24516a93..4cdf8953 100644 --- a/programming/flutter/api-reference/enum/grayscale-transformation-mode.md +++ b/programming/flutter/api-reference/enum/grayscale-transformation-mode.md @@ -19,15 +19,15 @@ breadcrumbText: EnumGrayscaleTransformationMode ```dart enum EnumGrayscaleEnhancementMode { - /** Bypasses grayscale transformation, leaving the image in its current state without any modification to its grayscale values. This mode is selected when no alteration of the grayscale data is desired, passing the image through to subsequent operations without modification. */ + /** Bypasses grayscale transformation, leaving the image in its current state without any modification to its grayscale values. This mode is selected when no alteration of the grayscale data is desired, passing the image through to subsequent operations without modification. **/ skip, - /** Applies an inversion to the grayscale values of the image, effectively transforming light elements to dark and vice versa. This mode is particularly useful for images with light text on dark backgrounds, enhancing visibility for further processing. */ + /** Applies an inversion to the grayscale values of the image, effectively transforming light elements to dark and vice versa. This mode is particularly useful for images with light text on dark backgrounds, enhancing visibility for further processing. **/ inverted, - /** Maintains the original grayscale values of the image without any transformation. This mode is suited for images with dark elements on light backgrounds, ensuring the natural contrast and detail are preserved for subsequent analysis. */ + /** Maintains the original grayscale values of the image without any transformation. This mode is suited for images with dark elements on light backgrounds, ensuring the natural contrast and detail are preserved for subsequent analysis. **/ original, - /** Delegates the choice of grayscale transformation to the library's algorithm, which automatically determines the most suitable transformation based on the image's characteristics. This mode is beneficial when the optimal transformation is not known in advance or varies across different images. */ + /** Delegates the choice of grayscale transformation to the library's algorithm, which automatically determines the most suitable transformation based on the image's characteristics. This mode is beneficial when the optimal transformation is not known in advance or varies across different images. **/ auto, - /** Placeholder value with no functional meaning. */ + /** Placeholder value with no functional meaning. **/ end } ``` diff --git a/programming/flutter/api-reference/enum/localization-mode.md b/programming/flutter/api-reference/enum/localization-mode.md index 7b29b1e8..312d0943 100644 --- a/programming/flutter/api-reference/enum/localization-mode.md +++ b/programming/flutter/api-reference/enum/localization-mode.md @@ -22,29 +22,29 @@ breadcrumbText: EnumLocalizationMode ```dart enum EnumLocalizationMode { - /** Omits the localization process entirely. */ + /** Omits the localization process entirely. **/ skip, - /** Automatic localization mode selection; not yet implemented so this is a placeholder until then. */ + /** Automatic localization mode selection; not yet implemented so this is a placeholder until then. **/ auto, - /** Identifies barcodes by finding connected blocks, offering optimal results, especially recommended for highest priority in most scenarios. */ + /** Identifies barcodes by finding connected blocks, offering optimal results, especially recommended for highest priority in most scenarios. **/ connectedBlocks, - /** Detects barcodes through analysis of patterns of contiguous black and white regions, tailored for QR Codes and DataMatrix codes. */ + /** Detects barcodes through analysis of patterns of contiguous black and white regions, tailored for QR Codes and DataMatrix codes. **/ statistics, - /** Locates barcodes by identifying linear patterns, designed primarily for 1D barcodes and PDF417 codes. */ + /** Locates barcodes by identifying linear patterns, designed primarily for 1D barcodes and PDF417 codes. **/ lines, - /** Provides rapid barcode localization, suited for interactive applications where speed is crucial. */ + /** Provides rapid barcode localization, suited for interactive applications where speed is crucial. **/ scanDirectly, - /** Targets barcode localization through detection of specific mark groups, optimized for Direct Part Marking (DPM) codes. */ + /** Targets barcode localization through detection of specific mark groups, optimized for Direct Part Marking (DPM) codes. **/ statisticsMarks, - /** Combines methods of locating connected blocks and linear patterns to efficiently localize postal codes. */ + /** Combines methods of locating connected blocks and linear patterns to efficiently localize postal codes. **/ statisticsPostalCode, - /** Initiates barcode localization from the image center, facilitating faster detection in certain layouts. */ + /** Initiates barcode localization from the image center, facilitating faster detection in certain layouts. **/ centre, - /** Specialized for quick localization of 1D barcodes, enhancing performance in fast-scan scenarios. */ + /** Specialized for quick localization of 1D barcodes, enhancing performance in fast-scan scenarios. **/ oneDFastScan, - /** Localizes barcodes by utilizing a neural network model. */ + /** Localizes barcodes by utilizing a neural network model. **/ neuralNetwork, - /** Placeholder value with no functional meaning. */ + /** Placeholder value with no functional meaning. **/ end } ``` diff --git a/programming/flutter/api-reference/enum/mapping-status.md b/programming/flutter/api-reference/enum/mapping-status.md index c67795a7..dc52029e 100644 --- a/programming/flutter/api-reference/enum/mapping-status.md +++ b/programming/flutter/api-reference/enum/mapping-status.md @@ -19,11 +19,11 @@ breadcrumbText: EnumMappingStatus ```dart enum EnumDeblurMode { - /** No mapping has been performed. */ + /** No mapping has been performed. **/ none, - /** Mapping of this field was successful. */ + /** Mapping of this field was successful. **/ succeeded, - /** Mapping of this field was unsuccessful. */ + /** Mapping of this field was unsuccessful. **/ failed } ``` diff --git a/programming/flutter/api-reference/enum/preset-template.md b/programming/flutter/api-reference/enum/preset-template.md index 5c3fac87..853521aa 100644 --- a/programming/flutter/api-reference/enum/preset-template.md +++ b/programming/flutter/api-reference/enum/preset-template.md @@ -20,10 +20,13 @@ breadcrumbText: EnumPresetTemplate ```dart static class EnumPresetTemplate { - static const defaultTemplate = "Default"; - static const readBarcodes = "ReadBarcodes_Default"; // the default template for the Barcode Reader that offers a balance between speed and read rate - static const readBarcodesSpeedFirst = "ReadBarcodes_SpeedFirst"; // prioritizes speed over read rate when reading barcodes - static const readBarcodesReadRateFirst = "ReadBarcodes_ReadRateFirst"; // prioritizes read rate over speed when reading barcodes - static const readSingleBarcode = "ReadSingleBarcode"; // focuses on the single-scan barcode reading mode and should not be used when reading multiple barcodes at a time + /** The default template for the Barcode Reader that offers a balance between speed and read rate **/ + static const readBarcodes = "ReadBarcodes_Default"; + /** The speed first template prioritizes speed over read rate when reading barcodes **/ + static const readBarcodesSpeedFirst = "ReadBarcodes_SpeedFirst"; + /** The read rate first template prioritizes read rate over speed when reading barcodes **/ + static const readBarcodesReadRateFirst = "ReadBarcodes_ReadRateFirst"; + /** The single barcode template focuses on the single-scan barcode reading mode and should not be used when reading multiple barcodes at a time as it is more speed focused. **/ + static const readSingleBarcode = "ReadSingleBarcode"; } ``` diff --git a/programming/flutter/api-reference/enum/result-status.md b/programming/flutter/api-reference/enum/result-status.md index e57fa778..0869b482 100644 --- a/programming/flutter/api-reference/enum/result-status.md +++ b/programming/flutter/api-reference/enum/result-status.md @@ -19,8 +19,11 @@ breadcrumbText: EnumResultStatus ```dart enum EnumResultStatus { + /** The barcode decoding process was a success and the result has been received **/ finished, + /** The barcode decoding process was cancelled by the user (usually by closing the UI using the close button) **/ canceled, + /** Something went wrong during the barcode decoding process and an exception has been thrown. **/ exception } ``` diff --git a/programming/flutter/api-reference/enum/scanning-mode.md b/programming/flutter/api-reference/enum/scanning-mode.md index 33c9e54e..f479d1b8 100644 --- a/programming/flutter/api-reference/enum/scanning-mode.md +++ b/programming/flutter/api-reference/enum/scanning-mode.md @@ -2,7 +2,7 @@ layout: default-layout title: EnumScanningMode - Dynamsoft Barcode Reader Flutter Edition description: EnumScanningMode of DynamsoftBarcodeReader Flutter is an enumeration class that defines the scanning mode. -keywords: BarcodeScanner, ScanningMode, flutter, +keywords: BarcodeScanner, ScanningMode, flutter, barcode reader, mode needAutoGenerateSidebar: true needGenerateH3Content: true breadcrumbText: EnumScanningMode @@ -19,7 +19,9 @@ breadcrumbText: EnumScanningMode ```dart enum EnumScanningMode { - single, // used for scanning a single barcode at a time, prioritizing speed over read rate - multiple // used for scanning multiple barcodes at a time, finding a balance between speed and read rate + /** Used for scanning a single barcode at a time, prioritizing speed over read rate **/ + single, + /** Used for scanning multiple barcodes at a time, finding a balance between speed and read rate **/ + multiple } ``` diff --git a/programming/flutter/api-reference/enum/validation-status.md b/programming/flutter/api-reference/enum/validation-status.md index bf0d088f..857e9b5f 100644 --- a/programming/flutter/api-reference/enum/validation-status.md +++ b/programming/flutter/api-reference/enum/validation-status.md @@ -23,11 +23,11 @@ breadcrumbText: EnumValidationStatus ```dart enum EnumDeblurMode { - /** No validation check has been performed. */ + /** No validation check has been performed. **/ none, - /** The validation of this field was successful. */ + /** The validation of this field was successful. **/ succeeded, - /** The validation of this field was unsuccessful. */ + /** The validation of this field was unsuccessful. **/ failed } ``` diff --git a/programming/flutter/explore-features/ui-customization.md b/programming/flutter/explore-features/ui-customization.md new file mode 100644 index 00000000..2cd8aba7 --- /dev/null +++ b/programming/flutter/explore-features/ui-customization.md @@ -0,0 +1,74 @@ +--- +layout: default-layout +title: UI Customization (Foundational Edition) - Dynamsoft Barcode Reader Flutter Edition +description: The UI customization guide for the foundational edition of Dynamsoft Barcode Reader Flutter. +keywords: ui, customization, foundational, Flutter, barcode reader +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# UI Customization Guide (Foundational Edition) + +One of the advantages of using the foundational edition of the Barcode Reader is that you can customize the UI however you see fit. In this guide we will walk through some of the ways in which you can customize the scanner UI using the Barcode Reader Foundational API. + +## Specifying a Scan Region + +You can limit the scan region of the SDK so that **it doesn't exhaust resources trying to read from the entire image or frame**. In order to do this, we must use the [`setScanRegion`](../api-reference/capture-vision-router-lite/camera-enhancer.md#setscanregion) method of the `CameraEnhancer` class. + +```dart +import 'package:dynamsoft_capture_vision_flutter/dynamsoft_capture_vision_flutter.dart'; + +final CameraEnhancer _camera = CameraEnhancer.instance; + +void initSdk() async { + //...... + await _cvr.setInput(_camera); + final scanRegion = DSRect(left: 0.1, top: 0.4, right: 0.9, bottom: 0.6, measuredInPercentage: true); + _camera.setScanRegion(scanRegion); + _camera.open(); +} +``` + +> [!TIP] +> It is recommended to have `measuredInPercentage` set to true to make the calculation process as easy as possible. + +Once a scan region is set, the region will by default be represented visually using a scan region mask. To control the visibility of this mask, please set the [`scanRegionMaskVisible`](../api-reference/capture-vision-router-lite/camera-view.md#scanregionmaskvisible) property of the `CameraView` to `false`. + +## Customizing the Camera View + +One of the main advantages of using the Camera Enhancer component to control camera operations is that it comes with a camera view UI that is fully customizable. + +The [`CameraView`](../api-reference/capture-vision-router-lite/camera-view.md) class comes with a few elements - namely a torch (flash) button, a scan region mask (if a scan region is set), a scan laser, and a drawing layer to highlight any detected barcodes. + +### Customizing the Flash Button + +The CameraView comes with its own default torch button that allows the user to toggle the camera's flash on or off. Through the [`CameraView`](../api-reference/capture-vision-router-lite/camera-view.md) and [`TorchButton`](../api-reference/capture-vision-router-lite/torch-button.md) classes, you can customize the appearance, size, and position of the torch button - as well as the visibility of the button. + +In this next code snippet, we will demonstrate how you can create and assign a custom TorchButton - as well as show the full CameraView configuration. + +> [!NOTE] +> The only required property that needs to be set in `CameraView` is the cameraEnhancer property. Any camera view component must be "attached" to a [`CameraEnhancer`](../api-reference/capture-vision-router-lite/camera-enhancer.md) instance. + +```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' +); +... +@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, // displays the torch button in the camera view + scanRegionMaskVisible: false, // hides the scan region mask so that the scan region is not represented visually + scanLaserVisible: true, // displays the scan laser - which is a simple bar that moves vertically within the scan region + torchButton: _torch, // assigns the custom torch button defined above to the camera view + visibleLayerIds: [EnumDrawingLayerId.dbr] // displays highlight boxes around detected barcodes + ) + ), +); +``` \ No newline at end of file diff --git a/programming/flutter/foundational-user-guide.md b/programming/flutter/foundational-user-guide.md index a3d7a4ef..fd1d5344 100644 --- a/programming/flutter/foundational-user-guide.md +++ b/programming/flutter/foundational-user-guide.md @@ -212,7 +212,7 @@ void initSettings() async { ### Specify the Scan Region -You can also limit the scan region of the SDK so that it doesn't exhaust resources trying to read from the entire image or frame. +You can also limit the scan region of the SDK so that it doesn't exhaust resources trying to read from the entire image or frame. In order to do this, we must use the [`setScanRegion`](api-reference/capture-vision-router-lite/camera-enhancer.md#setscanregion) method of the `CameraEnhancer` class. ```dart import 'package:dynamsoft_capture_vision_flutter/dynamsoft_capture_vision_flutter.dart'; @@ -221,8 +221,10 @@ final CameraEnhancer _camera = CameraEnhancer.instance; void initSdk() async { //...... + await _cvr.setInput(_camera); final scanRegion = DSRect(left: 0.1, top: 0.4, right: 0.9, bottom: 0.6, measuredInPercentage: true); _camera.setScanRegion(scanRegion); + _camera.open(); } ``` From 1c1018cdc4cafc4d0f0b8dfe0af934061258dc84 Mon Sep 17 00:00:00 2001 From: DMGithubPublisher Date: Fri, 10 Oct 2025 08:01:50 +0800 Subject: [PATCH 9/9] update to internal commit 460c0c40 --- .../programming-flutter.html | 1 + .../capture-vision-router-lite/feedback.md | 56 +++++++++++++++++++ .../flutter/foundational-user-guide.md | 19 ++----- 3 files changed, 63 insertions(+), 13 deletions(-) create mode 100644 programming/flutter/api-reference/capture-vision-router-lite/feedback.md diff --git a/_includes/sidelist-programming/programming-flutter.html b/_includes/sidelist-programming/programming-flutter.html index 2538b2e0..2a5afa9f 100644 --- a/_includes/sidelist-programming/programming-flutter.html +++ b/_includes/sidelist-programming/programming-flutter.html @@ -43,6 +43,7 @@
  • CameraEnhancer
  • CameraView
  • TorchButton
  • +
  • FeedBack
  • LicenseManager
  • ParsedResult
  • ParsedResultItem
  • diff --git a/programming/flutter/api-reference/capture-vision-router-lite/feedback.md b/programming/flutter/api-reference/capture-vision-router-lite/feedback.md new file mode 100644 index 00000000..00117969 --- /dev/null +++ b/programming/flutter/api-reference/capture-vision-router-lite/feedback.md @@ -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 beep() +``` + +### vibrate + +Triggers a vibration when a captured result is found. + +```dart +Future 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); + }); + } + }; +``` \ No newline at end of file diff --git a/programming/flutter/foundational-user-guide.md b/programming/flutter/foundational-user-guide.md index fd1d5344..8bf3aa94 100644 --- a/programming/flutter/foundational-user-guide.md +++ b/programming/flutter/foundational-user-guide.md @@ -210,23 +210,16 @@ void initSettings() async { > [!NOTE] > To learn how to create your own JSON template, please refer to this [page](https://www.dynamsoft.com/barcode-reader/docs/core/programming/features/use-runtimesettings-or-templates.html?lang=objc,swift#json-template). -### Specify the Scan Region +### UI Customization -You can also limit the scan region of the SDK so that it doesn't exhaust resources trying to read from the entire image or frame. In order to do this, we must use the [`setScanRegion`](api-reference/capture-vision-router-lite/camera-enhancer.md#setscanregion) method of the `CameraEnhancer` class. +If you would like to learn more on how to customize the UI, please refer to the [UI Customization](explore-features/ui-customization.md) guide. -```dart -import 'package:dynamsoft_capture_vision_flutter/dynamsoft_capture_vision_flutter.dart'; +### Enabling Haptic Feedback -final CameraEnhancer _camera = CameraEnhancer.instance; +Another feature that the Barcode Reader library offers is the ability to trigger a couple of haptic feedback reactions once a barcode is found. This is done via the [`FeedBack`](api-reference/capture-vision-router-lite/feedback.md) class - and it should be called in the result callback function so that the haptic feedback occurs once a barcode is successfully decoded. -void initSdk() async { - //...... - await _cvr.setInput(_camera); - final scanRegion = DSRect(left: 0.1, top: 0.4, right: 0.9, bottom: 0.6, measuredInPercentage: true); - _camera.setScanRegion(scanRegion); - _camera.open(); -} -``` +> [!NOTE] +> To see how the FeedBack class should be implemented to trigger these haptic feedback reactions once a barcode is found, please visit the [`FeedBack` API](api-reference/capture-vision-router-lite/feedback.md) page. ## Run the Project