diff --git a/_includes/sidelist-programming/programming-flutter.html b/_includes/sidelist-programming/programming-flutter.html index e2862c97..2a5afa9f 100644 --- a/_includes/sidelist-programming/programming-flutter.html +++ b/_includes/sidelist-programming/programming-flutter.html @@ -7,6 +7,11 @@
  • Driver License Guide
  • +
  • Explore Features + +
  • Demo & Samples
  • BarcodeScanner API @@ -36,6 +41,9 @@
  • DecodedBarcodesResult
  • BarcodeResultItem
  • CameraEnhancer
  • +
  • CameraView
  • +
  • TorchButton
  • +
  • FeedBack
  • LicenseManager
  • ParsedResult
  • ParsedResultItem
  • @@ -55,6 +63,9 @@
  • EnumCapturedResultItemType
  • EnumMappingStatus
  • EnumValidationStatus
  • +
  • EnumCameraPosition
  • +
  • EnumEnhancedFeatures
  • +
  • EnumDrawingLayerId
  • diff --git a/programming/flutter/api-reference/capture-vision-router-lite/barcode-result-item.md b/programming/flutter/api-reference/capture-vision-router-lite/barcode-result-item.md index 6ccab5ff..91b8cf5e 100644 --- a/programming/flutter/api-reference/capture-vision-router-lite/barcode-result-item.md +++ b/programming/flutter/api-reference/capture-vision-router-lite/barcode-result-item.md @@ -37,7 +37,7 @@ class BarcodeResultItem ### format -The format of the barcode represented as [`EnumBarcodeFormat`](./enum/barcode-format.md). +The format of the barcode represented as a [`EnumBarcodeFormat`](./enum/barcode-format.md). ```dart EnumBarcodeFormat format; 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 0bf03386..4ecf6ee3 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 @@ -32,12 +32,28 @@ Future open() ### setScanRegion -Sets the scan region of the camera and displays a bordered area on the UI to represent the scan region. +Sets the scan region of the camera and displays a bordered area on the UI to represent the scan region. To learn how to specify the scan region, please visit this [section of the foundational user guide](../../foundational-user-guide.md#specify-the-scan-region). ```dart Future setScanRegion( DSRect region ) ``` +**Remarks** + +This method must be called **after [`setInput`](capture-vision-router.md#setinput) and before the [`open`](#open) method**. + +### selectCamera + +Selects the camera based on the specified [`EnumCameraPosition`](../enum/camera-position.md). + +```dart +Future selectCamera(EnumCameraPosition position) +``` + +**Remarks** + +If you attempt to select the **backDualWideAuto** or the **backUltraWide** cameras on an Android phone, an exception will be thrown as those cameras are only available on iPhones. Supported devices include: iPhone 13 Pro, iPhone 13 Pro Max, iPhone 14 Pro, iPhone 14 Pro Max, iPhone 15 Pro, iPhone 15 Pro Max. This method must be called **after [`setInput`](capture-vision-router.md#setinput) and before the [`open`](#open) method**. + ### setZoomFactor Sets the zoom factor of the camera. @@ -62,6 +78,32 @@ Turns off the camera's flashlight (if available). Future turnOffTorch() ``` +### enableEnhancedFeatures + +Activates the selected enhanced features (represented by [`EnumEnhancedFeatures`](../enum/enhanced-features-camera.md)) provided by the Camera Enhancer library, including the auto-zoom and smart torch features. + +```dart +Future enableEnhancedFeatures( int features ) +``` + +**Remarks** + +This method must be used **after [`setInput`](capture-vision-router.md#setinput) and before the [`open`](#open) method**. If you would like to activate multiple enhanced features, then they must be combined using the OR (`|`) operator. + +```dart +await _cvr.setInput(_camera); +_camera.enableEnhancedFeatures(EnumEnhancedFeatures.autoZoom | EnumEnhancedFeatures.smartTorch); +_camera.open(); +``` + +### disableEnhancedFeatures + +Disables the selected and activated enhanced features (represented by [`EnumEnhancedFeatures`](../enum/enhanced-features-camera.md)) of the Camera Enhancer. + +```dart +Future disableEnhancedFeatures(int features) +``` + ### close Closes the camera and releases the related resources. When the `CaptureVisionRouter` instance calls `stopCapturing`, please make sure to call this method as well to ensure that the resources are released properly. diff --git a/programming/flutter/api-reference/capture-vision-router-lite/camera-view.md b/programming/flutter/api-reference/capture-vision-router-lite/camera-view.md new file mode 100644 index 00000000..44e4114b --- /dev/null +++ b/programming/flutter/api-reference/capture-vision-router-lite/camera-view.md @@ -0,0 +1,89 @@ +--- +layout: default-layout +title: CameraView Class - Dynamsoft Capture Vision Flutter +description: CameraView class of DCV Flutter edition displays a camera preview with customizable UI elements. +keywords: camera, enhancer, barcode reader, flutter, capture vision, view +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# CameraView + +`CameraView` is a widget that integrates with the `CameraEnhancer` - providing a camera interface with configurable and customizable UI components like torch control, scan region visualization, and custom drawing layers. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +class CameraView +``` + +## Properties + +### cameraEnhancer + +Sets the [`CameraEnhancer`](camera-enhancer.md) instance that the `CameraView` is attached to. The `CameraEnhancer` is responsible for the core camera operations, and so **this property must be defined when constructing the CameraView**. + +```dart +final CameraEnhancer cameraEnhancer; +``` + +### scanLaserVisible + +Determines whether the scan laser will be visible in the scan region or not. + +```dart +final bool? scanLaserVisible; +``` + +### scanRegionMaskVisible + +Establishes whether the scan region (if defined via the `CameraEnhancer`) will be represented visually using a mask. The mask highlights the area where the barcode scanning occurs, and it defaults to `true` if not specified. + +```dart +final bool? scanRegionMaskVisible; +``` + +**Remarks** + +To learn how to limit the scan region, please visit this [section of the foundational user guide](../../foundational-user-guide.md#specify-the-scan-region). + +### torchButtonVisible + +Controls the visibility of the torch/flash button that allows the user to activate the flash in low brightness scenarios. + +```dart +final bool? torchButtonVisible; +``` + +**Remarks** + +If no custom torch button is defined, the default torch icon will show up on the UI. + +### torchButton + +Defines a custom [`TorchButton`](torch-button.md) instead of the default torch icon that comes with the camera view. This property allows you to customize the size, position, and icon images of the torch button. + +```dart +final TorchButton? torchButton; +``` + +## Code Snippet + +```dart +@override +Widget build(BuildContext context) { +return Scaffold( + appBar: AppBar(backgroundColor: Theme.of(context).colorScheme.inversePrimary, title: Text(widget.title)), + body: Center(child: CameraView( + cameraEnhancer: _camera, + torchButtonVisible: true, + scanRegionMaskVisible: false, + scanLaserVisible: true, + torchButton: _torch, + visibleLayerIds: [EnumDrawingLayerId.dbr]) + ), +); +``` \ No newline at end of file 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 0067a92c..932ba21e 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 @@ -35,7 +35,7 @@ Captures an image using the specified template and processes it - outputting a [ Future capture( ImageData imageData, String templateName ) ``` -#### Remarks +**Remarks** The template that is used during processing can be a preset template (one of [`EnumPresetTemplate`](../enum/preset-template.md)) or a customized JSON template that you create or that is provided to you by the Dynamsoft team. @@ -47,7 +47,7 @@ Starts the capturing process using the specified template. Any result(s) (of typ Future startCapturing( String templateName ) ``` -#### Remarks +**Remarks** The template that is used during processing can be a preset template (one of [`EnumPresetTemplate`](../enum/preset-template.md)) or a customized JSON template that you create or that is provided to you by the Dynamsoft team. @@ -79,3 +79,35 @@ Future updateSettings( String templateName, SimplifiedCaptureVisionSetting For the `templateName` input parameter, this can be either the name of the `CaptureVisionTemplate` in a custom JSON template file/string or the name of one of the preset templates available via [`EnumPresetTemplate`](../enum/preset-template.md). +### getSimplifiedSettings + +Returns a subset of the full applied settings as a [`SimplifiedCaptureVisionSettings`](simplified-capture-vision-settings.md) object. This object contains the simplified settings of the Capture Vision Router instance, which in turn contains the simplified settings of the functional product used. + +```dart +Future getSimplifiedSettings(String templateName) async +``` + +**Remarks** + +The templateName parameter represents the Capture Vision template that has been applied, whether it is a [preset template](../enum/preset-template.md) or a custom template defined in a JSON template file or string. To learn how to use the `getSimplifiedSettings`, please refer to this [section of the Foundational User Guide](../../foundational-user-guide.md#using-simplifiedcapturevisionsettings). + +### resetSettings + +Resets all of the settings to their default values. + +```dart +Future resetSettings() async +``` + +### setInput + +Sets up an image source to provide images for continuous processing. This method is mainly used when configuring a camera (via the [`CameraEnhancer`](camera-enhancer.md)) as an input source. + +```dart +Future setInput(ImageSourceAdapter input) async +``` + +**Remarks** + +In most cases, the `ImageSourceAdapter` that will be used is a Camera Enhancer instance to allow the user to use their phone's built-in camera. + 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/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/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..8bf3aa94 100644 --- a/programming/flutter/foundational-user-guide.md +++ b/programming/flutter/foundational-user-guide.md @@ -210,21 +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. +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 { - //...... - final scanRegion = DSRect(left: 0.1, top: 0.4, right: 0.9, bottom: 0.6, measuredInPercentage: true); - _camera.setScanRegion(scanRegion); -} -``` +> [!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 diff --git a/programming/maui/samples/index.md b/programming/maui/samples/index.md index 784bddf9..a7c840b5 100644 --- a/programming/maui/samples/index.md +++ b/programming/maui/samples/index.md @@ -14,7 +14,7 @@ noTitleIndex: true - [Barcode Decoding Samples](#barcode-decoding-samples) - [ScanBarcodes_FoundationalAPI](#scanbarcodes_foundationalapi) - [ScanBarcodes_ReadyToUseComponent](#scanbarcodes_readytousecomponent) - - [ScanBarcodes_WithCameraEnhancer](#scanbarcodes_withcameraenhancer) + - [ScanDriverLicense](#scandriverlicense) ## Demos @@ -39,7 +39,6 @@ This is a sample that illustrates the simplest way to recognize barcodes from vi ### ScanDriverLicense - This sample demonstrates the simplest approach to 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-maui-samples/tree/main/ScanDriversLicense){:target="_blank"}