|
| 1 | +--- |
| 2 | +layout: default-layout |
| 3 | +title: MRZScannerConfig Class - Dynamsoft MRZ Scanner Flutter Edition |
| 4 | +description: MRZScannerConfig of DynamsoftMRZScanner Flutter is the class that defines the configurations for MRZ scanning. |
| 5 | +keywords: MRZ, scanner, config, flutter |
| 6 | +needAutoGenerateSidebar: true |
| 7 | +needGenerateH3Content: true |
| 8 | +breadcrumbText: MRZScannerConfig |
| 9 | +--- |
| 10 | + |
| 11 | +# MRZScannerConfig |
| 12 | + |
| 13 | +`MRZScannerConfig` is responsible for the configuration of the MRZ Scanner, from assigning the MRZ Scanner license to configuring the supported document types, along with other customizations. |
| 14 | + |
| 15 | +> [!NOTE] |
| 16 | +> If you are wondering about the different ways you can customize the MRZ Scanner, please refer to the [MRZ Scanner Customization Guide](../user-guide/customize-mrz-scanner.md). |
| 17 | +
|
| 18 | +## Definition |
| 19 | + |
| 20 | +*Assembly:* dynamsoft_mrz_scanner_bundle_flutter |
| 21 | + |
| 22 | +```dart |
| 23 | +final class MRZScannerConfig |
| 24 | +``` |
| 25 | + |
| 26 | +## Properties |
| 27 | + |
| 28 | +| Property | Type | Description | |
| 29 | +| -------- | ---- | ----------- | |
| 30 | +| [`license`](#license) | *String* | Represents the MRZ Scanner license string. | |
| 31 | +| [`templateFile`](#templatefile) | *String* | Specifies the template configuration that defines the various MRZ Scanner parameters. | |
| 32 | +| [`documentType`](#documenttype) | [*EnumDocumentType*](document-type.md) | Specifies the type of document (ID or Passport) that the MRZ Scanner will recognize. | |
| 33 | +| [`isTorchButtonVisible`](#istorchbuttonvisible) | *bool* | Represents the visibility status of the torch button. | |
| 34 | +| [`isBeepEnabled`](#isbeepenabled) | *bool* | Determines whether a beep sound is triggered upon a successful MRZ scan. | |
| 35 | +| [`isCloseButtonVisible`](#isclosebuttonvisible) | *bool* | Represents the visibility status of the close button. | |
| 36 | +| [`isGuideFrameVisible`](#isguideframevisible) | *bool* | Represents the visibility status of the guide frame on the display. | |
| 37 | +| [`isCameraToggleButtonVisible`](#Iscameratogglebuttonvisible) | *bool* | Specifies whether the camera toggle button is displayed or not. | |
| 38 | + |
| 39 | +### license |
| 40 | + |
| 41 | +The license key is the only property whose ***value must be specified when instantiating the MRZ Scanner instance***. If the license is undefined, invalid, or expired, the MRZ Scanner cannot proceed with scanning, and instead displays a pop-up error message instructing the user to contact the app administrator to resolve this license issue. |
| 42 | + |
| 43 | +```dart |
| 44 | +String license; |
| 45 | +``` |
| 46 | + |
| 47 | +### templateFile |
| 48 | + |
| 49 | +Specifies the template configuration with a file path or a JSON string that defines the various MRZ Scanner parameters. These specialized templates are usually used for very specific and customized scanning scenarios. |
| 50 | + |
| 51 | +```dart |
| 52 | +String? templateFile; |
| 53 | +``` |
| 54 | + |
| 55 | +**Remarks** |
| 56 | + |
| 57 | +The MRZ Scanner comes with a default template file, but you may choose to use a custom template to target specialized use cases. We recommend contacting the [Dynamsoft Technical Support Team](https://www.dynamsoft.com/company/contact/) for assistance with template customization. |
| 58 | + |
| 59 | +### documentType |
| 60 | + |
| 61 | +Specifies the type of document that the MRZ Scanner will recognize, represented as a [`EnumDocumentType`](document-type.md). This property accepts values defined in the EnumDocumentType such as `EnumDocumentType.all` (TD1/2/3), `EnumDocumentType.id` (TD1/2), or `EnumDocumentType.passport` (TD3). |
| 62 | + |
| 63 | +```dart |
| 64 | +EnumDocumentType? documentType; |
| 65 | +``` |
| 66 | + |
| 67 | +**Remarks** |
| 68 | + |
| 69 | +If you would like to learn more about the supported document types, please refer to the [Supported Document Types](../user-guide/index.md#supported-machine-readable-travel-document-types) section of the user guide. |
| 70 | + |
| 71 | +### isTorchButtonVisible |
| 72 | + |
| 73 | +Determines whether the torch (flashlight) toggle button is visible on the scanning interface. Set to true to allow users to switch the device's flashlight on or off during MRZ scanning. |
| 74 | + |
| 75 | +```dart |
| 76 | +bool? isTorchButtonVisible; |
| 77 | +``` |
| 78 | + |
| 79 | +### isBeepEnabled |
| 80 | + |
| 81 | +Determines whether a beep sound is triggered upon a successful MRZ scan. When enabled (true), the scanner will play a sound to provide audible feedback. |
| 82 | + |
| 83 | +```dart |
| 84 | +bool? isBeepEnabled; |
| 85 | +``` |
| 86 | + |
| 87 | +### isCloseButtonVisible |
| 88 | + |
| 89 | +Controls the visibility of the close button on the scanner's UI. If true, a close button will be displayed allowing users to exit the MRZ scanning interface. |
| 90 | + |
| 91 | +```dart |
| 92 | +bool? isCloseButtonVisible; |
| 93 | +``` |
| 94 | + |
| 95 | +### IsGuideFrameVisible |
| 96 | + |
| 97 | +Represents the visibility status of the guide frame on the display. |
| 98 | + |
| 99 | +```dart |
| 100 | +bool IsGuideFrameVisible { get; set; }; |
| 101 | +``` |
| 102 | + |
| 103 | +### isCameraToggleButtonVisible |
| 104 | + |
| 105 | +Specifies whether the camera toggle button is displayed. This button lets users switch between available cameras (e.g., front and rear). |
| 106 | + |
| 107 | +```dart |
| 108 | +bool? isCameraToggleButtonVisible; |
| 109 | +``` |
0 commit comments