From 90d0e3638a3dff11db2a9ee424010f35e213757f Mon Sep 17 00:00:00 2001 From: Denis Averin Date: Wed, 28 Feb 2024 17:33:21 +0700 Subject: [PATCH 1/6] Update github checkout version from v3 to v4 --- .github/workflows/check-badges.yml | 2 +- .github/workflows/dart.yml | 2 +- README.md | 2 +- lib/src/model/auto_size_mode.dart | 4 ++++ lib/src/model/available_graphics_unit.dart | 4 ++++ lib/src/model/aztec_encode_mode.dart | 4 ++++ lib/src/model/aztec_symbol_mode.dart | 4 ++++ lib/src/model/border_dash_style.dart | 4 ++++ lib/src/model/checksum_validation.dart | 4 ++++ lib/src/model/codabar_checksum_mode.dart | 4 ++++ lib/src/model/codabar_symbol.dart | 4 ++++ lib/src/model/code128_emulation.dart | 4 ++++ lib/src/model/code128_encode_mode.dart | 4 ++++ lib/src/model/code_location.dart | 4 ++++ lib/src/model/customer_information_interpreting_type.dart | 7 +++++++ lib/src/model/data_matrix_ecc_type.dart | 4 ++++ lib/src/model/data_matrix_encode_mode.dart | 4 ++++ lib/src/model/data_matrix_version.dart | 4 ++++ lib/src/model/dot_code_encode_mode.dart | 4 ++++ lib/src/model/eci_encodings.dart | 4 ++++ lib/src/model/enable_checksum.dart | 4 ++++ lib/src/model/encode_barcode_type.dart | 4 ++++ lib/src/model/font_mode.dart | 4 ++++ lib/src/model/font_style.dart | 4 ++++ lib/src/model/han_xin_encode_mode.dart | 4 ++++ lib/src/model/han_xin_error_level.dart | 4 ++++ lib/src/model/han_xin_version.dart | 4 ++++ lib/src/model/itf14_border_type.dart | 4 ++++ lib/src/model/macro_character.dart | 4 ++++ lib/src/model/maxi_code_encode_mode.dart | 4 ++++ lib/src/model/maxi_code_mode.dart | 4 ++++ lib/src/model/patch_format.dart | 4 ++++ lib/src/model/pdf417_compaction_mode.dart | 4 ++++ lib/src/model/pdf417_error_level.dart | 4 ++++ lib/src/model/pdf417_macro_terminator.dart | 4 ++++ lib/src/model/preset_type.dart | 4 ++++ lib/src/model/qr_encode_mode.dart | 4 ++++ lib/src/model/qr_encode_type.dart | 4 ++++ lib/src/model/qr_error_level.dart | 4 ++++ lib/src/model/qr_version.dart | 4 ++++ lib/src/model/text_alignment.dart | 4 ++++ pubspec.yaml | 1 + 42 files changed, 159 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-badges.yml b/.github/workflows/check-badges.yml index 173e8cd..d673011 100644 --- a/.github/workflows/check-badges.yml +++ b/.github/workflows/check-badges.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check badges in README.md run: ./scripts/check-badges.bash "README.md" diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index d5294af..106a7ab 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dart-lang/setup-dart@v1 - name: Install dependencies diff --git a/README.md b/README.md index c9ce4fc..f192ed1 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ To use these SDKs, you will need Client Id and Client Secret which can be looked ## Prerequisites -To use Aspose.BarCode Cloud SDK for Dart you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and SID at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is a free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/pricing). +To use Aspose.BarCode Cloud SDK for Dart you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and SID at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is a free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/). ## Requirements diff --git a/lib/src/model/auto_size_mode.dart b/lib/src/model/auto_size_mode.dart index d9a6962..8805cc1 100644 --- a/lib/src/model/auto_size_mode.dart +++ b/lib/src/model/auto_size_mode.dart @@ -40,4 +40,8 @@ class AutoSizeMode { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => AutoSizeMode.fromJson(value)).toList(); + } } diff --git a/lib/src/model/available_graphics_unit.dart b/lib/src/model/available_graphics_unit.dart index 88f2a48..65587d3 100644 --- a/lib/src/model/available_graphics_unit.dart +++ b/lib/src/model/available_graphics_unit.dart @@ -49,4 +49,8 @@ class AvailableGraphicsUnit { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => AvailableGraphicsUnit.fromJson(value)).toList(); + } } diff --git a/lib/src/model/aztec_encode_mode.dart b/lib/src/model/aztec_encode_mode.dart index c05119f..0820e6a 100644 --- a/lib/src/model/aztec_encode_mode.dart +++ b/lib/src/model/aztec_encode_mode.dart @@ -41,4 +41,8 @@ class AztecEncodeMode { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => AztecEncodeMode.fromJson(value)).toList(); + } } diff --git a/lib/src/model/aztec_symbol_mode.dart b/lib/src/model/aztec_symbol_mode.dart index 2443da6..598e55f 100644 --- a/lib/src/model/aztec_symbol_mode.dart +++ b/lib/src/model/aztec_symbol_mode.dart @@ -46,4 +46,8 @@ class AztecSymbolMode { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => AztecSymbolMode.fromJson(value)).toList(); + } } diff --git a/lib/src/model/border_dash_style.dart b/lib/src/model/border_dash_style.dart index c3cbf02..b17f0b4 100644 --- a/lib/src/model/border_dash_style.dart +++ b/lib/src/model/border_dash_style.dart @@ -52,4 +52,8 @@ class BorderDashStyle { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => BorderDashStyle.fromJson(value)).toList(); + } } diff --git a/lib/src/model/checksum_validation.dart b/lib/src/model/checksum_validation.dart index bf7c472..38351bc 100644 --- a/lib/src/model/checksum_validation.dart +++ b/lib/src/model/checksum_validation.dart @@ -40,4 +40,8 @@ class ChecksumValidation { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => ChecksumValidation.fromJson(value)).toList(); + } } diff --git a/lib/src/model/codabar_checksum_mode.dart b/lib/src/model/codabar_checksum_mode.dart index 67c5c02..a15f35f 100644 --- a/lib/src/model/codabar_checksum_mode.dart +++ b/lib/src/model/codabar_checksum_mode.dart @@ -34,4 +34,8 @@ class CodabarChecksumMode { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => CodabarChecksumMode.fromJson(value)).toList(); + } } diff --git a/lib/src/model/codabar_symbol.dart b/lib/src/model/codabar_symbol.dart index 56b64aa..e99e48d 100644 --- a/lib/src/model/codabar_symbol.dart +++ b/lib/src/model/codabar_symbol.dart @@ -46,4 +46,8 @@ class CodabarSymbol { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => CodabarSymbol.fromJson(value)).toList(); + } } diff --git a/lib/src/model/code128_emulation.dart b/lib/src/model/code128_emulation.dart index d2be901..e41e1bd 100644 --- a/lib/src/model/code128_emulation.dart +++ b/lib/src/model/code128_emulation.dart @@ -46,4 +46,8 @@ class Code128Emulation { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => Code128Emulation.fromJson(value)).toList(); + } } diff --git a/lib/src/model/code128_encode_mode.dart b/lib/src/model/code128_encode_mode.dart index f2bca7e..f8860ec 100644 --- a/lib/src/model/code128_encode_mode.dart +++ b/lib/src/model/code128_encode_mode.dart @@ -64,4 +64,8 @@ class Code128EncodeMode { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => Code128EncodeMode.fromJson(value)).toList(); + } } diff --git a/lib/src/model/code_location.dart b/lib/src/model/code_location.dart index 93b620a..ecc4cea 100644 --- a/lib/src/model/code_location.dart +++ b/lib/src/model/code_location.dart @@ -40,4 +40,8 @@ class CodeLocation { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => CodeLocation.fromJson(value)).toList(); + } } diff --git a/lib/src/model/customer_information_interpreting_type.dart b/lib/src/model/customer_information_interpreting_type.dart index ca88480..83f417c 100644 --- a/lib/src/model/customer_information_interpreting_type.dart +++ b/lib/src/model/customer_information_interpreting_type.dart @@ -43,4 +43,11 @@ class CustomerInformationInterpretingType { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson( + List json) { + return json + .map((value) => CustomerInformationInterpretingType.fromJson(value)) + .toList(); + } } diff --git a/lib/src/model/data_matrix_ecc_type.dart b/lib/src/model/data_matrix_ecc_type.dart index 13822d1..b003a86 100644 --- a/lib/src/model/data_matrix_ecc_type.dart +++ b/lib/src/model/data_matrix_ecc_type.dart @@ -64,4 +64,8 @@ class DataMatrixEccType { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => DataMatrixEccType.fromJson(value)).toList(); + } } diff --git a/lib/src/model/data_matrix_encode_mode.dart b/lib/src/model/data_matrix_encode_mode.dart index b3c3077..42d58a1 100644 --- a/lib/src/model/data_matrix_encode_mode.dart +++ b/lib/src/model/data_matrix_encode_mode.dart @@ -80,4 +80,8 @@ class DataMatrixEncodeMode { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => DataMatrixEncodeMode.fromJson(value)).toList(); + } } diff --git a/lib/src/model/data_matrix_version.dart b/lib/src/model/data_matrix_version.dart index ab07d6e..8287b86 100644 --- a/lib/src/model/data_matrix_version.dart +++ b/lib/src/model/data_matrix_version.dart @@ -514,4 +514,8 @@ class DataMatrixVersion { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => DataMatrixVersion.fromJson(value)).toList(); + } } diff --git a/lib/src/model/dot_code_encode_mode.dart b/lib/src/model/dot_code_encode_mode.dart index 5811dd0..152c521 100644 --- a/lib/src/model/dot_code_encode_mode.dart +++ b/lib/src/model/dot_code_encode_mode.dart @@ -41,4 +41,8 @@ class DotCodeEncodeMode { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => DotCodeEncodeMode.fromJson(value)).toList(); + } } diff --git a/lib/src/model/eci_encodings.dart b/lib/src/model/eci_encodings.dart index 156d3d3..439e815 100644 --- a/lib/src/model/eci_encodings.dart +++ b/lib/src/model/eci_encodings.dart @@ -184,4 +184,8 @@ class ECIEncodings { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => ECIEncodings.fromJson(value)).toList(); + } } diff --git a/lib/src/model/enable_checksum.dart b/lib/src/model/enable_checksum.dart index 6970ae3..4e559d8 100644 --- a/lib/src/model/enable_checksum.dart +++ b/lib/src/model/enable_checksum.dart @@ -40,4 +40,8 @@ class EnableChecksum { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => EnableChecksum.fromJson(value)).toList(); + } } diff --git a/lib/src/model/encode_barcode_type.dart b/lib/src/model/encode_barcode_type.dart index aff5ab3..e83724b 100644 --- a/lib/src/model/encode_barcode_type.dart +++ b/lib/src/model/encode_barcode_type.dart @@ -490,4 +490,8 @@ class EncodeBarcodeType { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => EncodeBarcodeType.fromJson(value)).toList(); + } } diff --git a/lib/src/model/font_mode.dart b/lib/src/model/font_mode.dart index 2d092c2..f300042 100644 --- a/lib/src/model/font_mode.dart +++ b/lib/src/model/font_mode.dart @@ -34,4 +34,8 @@ class FontMode { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => FontMode.fromJson(value)).toList(); + } } diff --git a/lib/src/model/font_style.dart b/lib/src/model/font_style.dart index fe741e0..541d095 100644 --- a/lib/src/model/font_style.dart +++ b/lib/src/model/font_style.dart @@ -52,4 +52,8 @@ class FontStyle { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => FontStyle.fromJson(value)).toList(); + } } diff --git a/lib/src/model/han_xin_encode_mode.dart b/lib/src/model/han_xin_encode_mode.dart index 714d307..1c92081 100644 --- a/lib/src/model/han_xin_encode_mode.dart +++ b/lib/src/model/han_xin_encode_mode.dart @@ -58,4 +58,8 @@ class HanXinEncodeMode { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => HanXinEncodeMode.fromJson(value)).toList(); + } } diff --git a/lib/src/model/han_xin_error_level.dart b/lib/src/model/han_xin_error_level.dart index e0ab793..69340dc 100644 --- a/lib/src/model/han_xin_error_level.dart +++ b/lib/src/model/han_xin_error_level.dart @@ -46,4 +46,8 @@ class HanXinErrorLevel { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => HanXinErrorLevel.fromJson(value)).toList(); + } } diff --git a/lib/src/model/han_xin_version.dart b/lib/src/model/han_xin_version.dart index b237f1c..b94cfe6 100644 --- a/lib/src/model/han_xin_version.dart +++ b/lib/src/model/han_xin_version.dart @@ -532,4 +532,8 @@ class HanXinVersion { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => HanXinVersion.fromJson(value)).toList(); + } } diff --git a/lib/src/model/itf14_border_type.dart b/lib/src/model/itf14_border_type.dart index 0308b7f..f1d2ad6 100644 --- a/lib/src/model/itf14_border_type.dart +++ b/lib/src/model/itf14_border_type.dart @@ -52,4 +52,8 @@ class ITF14BorderType { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => ITF14BorderType.fromJson(value)).toList(); + } } diff --git a/lib/src/model/macro_character.dart b/lib/src/model/macro_character.dart index 6259047..bd473b3 100644 --- a/lib/src/model/macro_character.dart +++ b/lib/src/model/macro_character.dart @@ -40,4 +40,8 @@ class MacroCharacter { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => MacroCharacter.fromJson(value)).toList(); + } } diff --git a/lib/src/model/maxi_code_encode_mode.dart b/lib/src/model/maxi_code_encode_mode.dart index d0333f1..8561684 100644 --- a/lib/src/model/maxi_code_encode_mode.dart +++ b/lib/src/model/maxi_code_encode_mode.dart @@ -41,4 +41,8 @@ class MaxiCodeEncodeMode { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => MaxiCodeEncodeMode.fromJson(value)).toList(); + } } diff --git a/lib/src/model/maxi_code_mode.dart b/lib/src/model/maxi_code_mode.dart index 32a9d7f..754e1d4 100644 --- a/lib/src/model/maxi_code_mode.dart +++ b/lib/src/model/maxi_code_mode.dart @@ -52,4 +52,8 @@ class MaxiCodeMode { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => MaxiCodeMode.fromJson(value)).toList(); + } } diff --git a/lib/src/model/patch_format.dart b/lib/src/model/patch_format.dart index 3dfe49d..8417d5d 100644 --- a/lib/src/model/patch_format.dart +++ b/lib/src/model/patch_format.dart @@ -53,4 +53,8 @@ class PatchFormat { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => PatchFormat.fromJson(value)).toList(); + } } diff --git a/lib/src/model/pdf417_compaction_mode.dart b/lib/src/model/pdf417_compaction_mode.dart index 65d1b25..ff81ab1 100644 --- a/lib/src/model/pdf417_compaction_mode.dart +++ b/lib/src/model/pdf417_compaction_mode.dart @@ -48,4 +48,8 @@ class Pdf417CompactionMode { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => Pdf417CompactionMode.fromJson(value)).toList(); + } } diff --git a/lib/src/model/pdf417_error_level.dart b/lib/src/model/pdf417_error_level.dart index 1b4f8a4..e4f055e 100644 --- a/lib/src/model/pdf417_error_level.dart +++ b/lib/src/model/pdf417_error_level.dart @@ -76,4 +76,8 @@ class Pdf417ErrorLevel { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => Pdf417ErrorLevel.fromJson(value)).toList(); + } } diff --git a/lib/src/model/pdf417_macro_terminator.dart b/lib/src/model/pdf417_macro_terminator.dart index cfb9de1..504fcd3 100644 --- a/lib/src/model/pdf417_macro_terminator.dart +++ b/lib/src/model/pdf417_macro_terminator.dart @@ -40,4 +40,8 @@ class Pdf417MacroTerminator { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => Pdf417MacroTerminator.fromJson(value)).toList(); + } } diff --git a/lib/src/model/preset_type.dart b/lib/src/model/preset_type.dart index f57ba95..30b158c 100644 --- a/lib/src/model/preset_type.dart +++ b/lib/src/model/preset_type.dart @@ -60,4 +60,8 @@ class PresetType { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => PresetType.fromJson(value)).toList(); + } } diff --git a/lib/src/model/qr_encode_mode.dart b/lib/src/model/qr_encode_mode.dart index 9040bc1..9211c15 100644 --- a/lib/src/model/qr_encode_mode.dart +++ b/lib/src/model/qr_encode_mode.dart @@ -59,4 +59,8 @@ class QREncodeMode { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => QREncodeMode.fromJson(value)).toList(); + } } diff --git a/lib/src/model/qr_encode_type.dart b/lib/src/model/qr_encode_type.dart index 3eb67be..9606670 100644 --- a/lib/src/model/qr_encode_type.dart +++ b/lib/src/model/qr_encode_type.dart @@ -40,4 +40,8 @@ class QREncodeType { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => QREncodeType.fromJson(value)).toList(); + } } diff --git a/lib/src/model/qr_error_level.dart b/lib/src/model/qr_error_level.dart index 50b80bf..67ec36f 100644 --- a/lib/src/model/qr_error_level.dart +++ b/lib/src/model/qr_error_level.dart @@ -46,4 +46,8 @@ class QRErrorLevel { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => QRErrorLevel.fromJson(value)).toList(); + } } diff --git a/lib/src/model/qr_version.dart b/lib/src/model/qr_version.dart index 7f2610f..eb23cfb 100644 --- a/lib/src/model/qr_version.dart +++ b/lib/src/model/qr_version.dart @@ -292,4 +292,8 @@ class QRVersion { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => QRVersion.fromJson(value)).toList(); + } } diff --git a/lib/src/model/text_alignment.dart b/lib/src/model/text_alignment.dart index fe1eb0e..a3ac13d 100644 --- a/lib/src/model/text_alignment.dart +++ b/lib/src/model/text_alignment.dart @@ -40,4 +40,8 @@ class TextAlignment { String toString() { return value == null ? "null" : value.toString(); } + + static List listFromJson(List json) { + return json.map((value) => TextAlignment.fromJson(value)).toList(); + } } diff --git a/pubspec.yaml b/pubspec.yaml index b241238..a49a6db 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,6 +15,7 @@ environment: dependencies: http: '>=0.13.0 <2.0.0' + dev_dependencies: lints: ^3.0.0 test: ^1.25.1 From 4cd85b84cfbcc0c498e40cb158a8c07ef4631c31 Mon Sep 17 00:00:00 2001 From: Denis Averin Date: Wed, 28 Feb 2024 18:44:51 +0700 Subject: [PATCH 2/6] Update version to 1.24.2 --- README.md | 4 ++-- lib/src/api_client.dart | 2 +- pubspec.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f192ed1..5f3bd16 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Dart test](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dart/actions/workflows/dart.yml/badge.svg?branch=main)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dart/actions/workflows/dart.yml) - API version: 3.0 -- SDK version: 1.24.1 +- SDK version: 1.24.2 This SDK allows you to work with Aspose.BarCode for Cloud REST APIs in your Dart or Flutter applications quickly and easily @@ -34,7 +34,7 @@ Add this dependency to your *pubspec.yaml*: ```yaml dependencies: - aspose_barcode_cloud: 1.24.1 + aspose_barcode_cloud: 1.24.2 ``` ## Sample usage diff --git a/lib/src/api_client.dart b/lib/src/api_client.dart index 116c9d6..bd3b946 100644 --- a/lib/src/api_client.dart +++ b/lib/src/api_client.dart @@ -6,7 +6,7 @@ import '../aspose_barcode_cloud.dart'; import 'api_helper.dart'; import 'auth/authentication.dart'; -const String SDK_VERSION = "1.24.1"; +const String SDK_VERSION = "1.24.2"; class ApiClient { late final String basePath; diff --git a/pubspec.yaml b/pubspec.yaml index a49a6db..86a9895 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: aspose_barcode_cloud description: This SDK allows you to work with Aspose.BarCode for Cloud REST APIs in your Dart or Flutter applications quickly and easily -version: 1.24.1 +version: 1.24.2 homepage: https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dart platforms: From a271296f93c6993b076a0f931e7e17ce540bb508 Mon Sep 17 00:00:00 2001 From: Denis Averin Date: Wed, 28 Feb 2024 19:43:08 +0700 Subject: [PATCH 3/6] Use lints/recommended.yaml instead of lints/core.yaml --- Makefile | 2 +- analysis_options.yaml | 5 ++--- example/main.dart | 6 +++--- test/configuration_test.dart | 2 +- ..._generate_file_put_barcode_recognize_from_body_test.dart | 2 +- test/put_generate_multiple_get_barcode_recognize_test.dart | 2 +- test/test_config.dart | 6 +++--- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 6b306db..131c79a 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ cover: # dart pub global activate coverage # Run Dart tests and output them at directory `./coverage`: - dart pub global run coverage:test_with_coverage + dart run coverage:test_with_coverage # Generate HTML from LCOV report: # Install lcov with `brew install lcov` or `apt-get install lcov` diff --git a/analysis_options.yaml b/analysis_options.yaml index c498f82..71fe0d4 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,3 +1,2 @@ -include: package:lints/core.yaml -# More strict -# include: package:lints/recommended.yaml +# More strict than package:lints/core.yaml +include: package:lints/recommended.yaml diff --git a/example/main.dart b/example/main.dart index ff4ec54..19266fa 100644 --- a/example/main.dart +++ b/example/main.dart @@ -21,7 +21,7 @@ Future main() async { // Save generated image to file File(fileName).writeAsBytesSync(generated); - print("Generated image saved to " + fileName); + print("Generated image saved to '$fileName'"); // Recognize generated image final formFile = MultipartFile.fromBytes("image", generated.toList(), @@ -33,8 +33,8 @@ Future main() async { ); if (recognized.barcodes != null && recognized.barcodes!.isNotEmpty) { - print("Recognized Type: " + recognized.barcodes![0].type!); - print("Recognized Value: " + recognized.barcodes![0].barcodeValue!); + print("Recognized Type: ${recognized.barcodes![0].type!}"); + print("Recognized Value: ${recognized.barcodes![0].barcodeValue!}"); } else { print("No barcode found"); } diff --git a/test/configuration_test.dart b/test/configuration_test.dart index 099d620..1a5ff04 100644 --- a/test/configuration_test.dart +++ b/test/configuration_test.dart @@ -5,7 +5,7 @@ import 'package:test/test.dart'; void main() { final configFileName = - "test" + Platform.pathSeparator + "configuration.example.json"; + "test${Platform.pathSeparator}configuration.example.json"; test('Save default Configuration', () async { final config = Configuration( diff --git a/test/put_barcode_generate_file_put_barcode_recognize_from_body_test.dart b/test/put_barcode_generate_file_put_barcode_recognize_from_body_test.dart index 6a21db3..9cec0fc 100644 --- a/test/put_barcode_generate_file_put_barcode_recognize_from_body_test.dart +++ b/test/put_barcode_generate_file_put_barcode_recognize_from_body_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; import 'test_config.dart'; void main() { - final remoteFileName = TestConfig.generateRandomString(16) + ".png"; + final remoteFileName = "${TestConfig.generateRandomString(16)}.png"; test('.putBarcodeGenerateFile', () async { final ResultImageInfo generated = await TestConfig.barcodeApi diff --git a/test/put_generate_multiple_get_barcode_recognize_test.dart b/test/put_generate_multiple_get_barcode_recognize_test.dart index c02541d..4c162c2 100644 --- a/test/put_generate_multiple_get_barcode_recognize_test.dart +++ b/test/put_generate_multiple_get_barcode_recognize_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; import 'test_config.dart'; void main() { - final remoteFileName = TestConfig.generateRandomString(16) + ".png"; + final remoteFileName = "${TestConfig.generateRandomString(16)}.png"; test('.putGenerateMultiple', () async { final barcode = GeneratorParams() diff --git a/test/test_config.dart b/test/test_config.dart index d1fad7b..3499cba 100644 --- a/test/test_config.dart +++ b/test/test_config.dart @@ -4,9 +4,9 @@ import 'dart:math'; import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart'; class TestConfig { - static final configuration = Configuration.load( - "test" + Platform.pathSeparator + "configuration.json") ?? - Configuration.fromEnv(prefix: "TEST_CONFIGURATION_"); + static final configuration = + Configuration.load("test${Platform.pathSeparator}configuration.json") ?? + Configuration.fromEnv(prefix: "TEST_CONFIGURATION_"); static final apiClient = ApiClient(configuration); static final barcodeApi = BarcodeApi(apiClient); From c06df3ffdfa25e83c712019b342f257ffd2da3ee Mon Sep 17 00:00:00 2001 From: Denis Averin Date: Wed, 28 Feb 2024 20:09:26 +0700 Subject: [PATCH 4/6] Fix lint errors --- Makefile | 4 +- lib/src/api/barcode_api.dart | 18 +- lib/src/api/file_api.dart | 22 +-- lib/src/api/folder_api.dart | 22 +-- lib/src/api/storage_api.dart | 16 +- lib/src/api_client.dart | 10 +- lib/src/api_exception.dart | 10 +- lib/src/api_helper.dart | 2 +- lib/src/auth/oauth.dart | 6 +- lib/src/configuration.dart | 4 +- lib/src/model/api_error.dart | 12 +- lib/src/model/api_error_response.dart | 6 +- lib/src/model/australian_post_params.dart | 10 +- lib/src/model/auto_size_mode.dart | 1 + lib/src/model/available_graphics_unit.dart | 1 + lib/src/model/aztec_encode_mode.dart | 1 + lib/src/model/aztec_params.dart | 21 ++- lib/src/model/aztec_symbol_mode.dart | 1 + lib/src/model/barcode_response.dart | 8 +- lib/src/model/barcode_response_list.dart | 2 +- lib/src/model/border_dash_style.dart | 1 + lib/src/model/caption_params.dart | 16 +- lib/src/model/checksum_validation.dart | 1 + lib/src/model/codabar_checksum_mode.dart | 1 + lib/src/model/codabar_params.dart | 8 +- lib/src/model/codabar_symbol.dart | 1 + lib/src/model/codablock_params.dart | 11 +- lib/src/model/code128_emulation.dart | 1 + lib/src/model/code128_encode_mode.dart | 1 + lib/src/model/code128_params.dart | 4 +- lib/src/model/code16_k_params.dart | 11 +- lib/src/model/code_location.dart | 1 + lib/src/model/coupon_params.dart | 8 +- ...ustomer_information_interpreting_type.dart | 1 + lib/src/model/data_bar_params.dart | 15 +- lib/src/model/data_matrix_ecc_type.dart | 1 + lib/src/model/data_matrix_encode_mode.dart | 1 + lib/src/model/data_matrix_params.dart | 21 ++- lib/src/model/data_matrix_version.dart | 1 + lib/src/model/decode_barcode_type.dart | 1 + lib/src/model/disc_usage.dart | 6 +- lib/src/model/dot_code_encode_mode.dart | 1 + lib/src/model/dot_code_params.dart | 17 +- lib/src/model/eci_encodings.dart | 1 + lib/src/model/enable_checksum.dart | 1 + lib/src/model/encode_barcode_type.dart | 1 + lib/src/model/error.dart | 10 +- lib/src/model/error_details.dart | 6 +- lib/src/model/file_version.dart | 16 +- lib/src/model/file_versions.dart | 2 +- lib/src/model/files_list.dart | 2 +- lib/src/model/files_upload_result.dart | 2 +- lib/src/model/font_mode.dart | 1 + lib/src/model/font_params.dart | 10 +- lib/src/model/font_style.dart | 1 + lib/src/model/generator_params.dart | 154 ++++++++---------- lib/src/model/generator_params_list.dart | 6 +- lib/src/model/han_xin_encode_mode.dart | 1 + lib/src/model/han_xin_error_level.dart | 1 + lib/src/model/han_xin_params.dart | 10 +- lib/src/model/han_xin_version.dart | 1 + lib/src/model/itf14_border_type.dart | 1 + lib/src/model/itf_params.dart | 12 +- lib/src/model/macro_character.dart | 1 + lib/src/model/maxi_code_encode_mode.dart | 1 + lib/src/model/maxi_code_mode.dart | 1 + lib/src/model/maxi_code_params.dart | 11 +- lib/src/model/object_exist.dart | 6 +- lib/src/model/padding.dart | 18 +- lib/src/model/patch_code_params.dart | 6 +- lib/src/model/patch_format.dart | 1 + lib/src/model/pdf417_compaction_mode.dart | 1 + lib/src/model/pdf417_error_level.dart | 1 + lib/src/model/pdf417_macro_terminator.dart | 1 + lib/src/model/pdf417_params.dart | 53 +++--- lib/src/model/postal_params.dart | 8 +- lib/src/model/preset_type.dart | 1 + lib/src/model/qr_encode_mode.dart | 1 + lib/src/model/qr_encode_type.dart | 1 + lib/src/model/qr_error_level.dart | 1 + lib/src/model/qr_params.dart | 21 ++- lib/src/model/qr_version.dart | 1 + lib/src/model/reader_params.dart | 77 +++++---- lib/src/model/region_point.dart | 6 +- lib/src/model/result_image_info.dart | 8 +- lib/src/model/storage_exist.dart | 4 +- lib/src/model/storage_file.dart | 12 +- lib/src/model/structured_append.dart | 8 +- lib/src/model/text_alignment.dart | 1 + 89 files changed, 403 insertions(+), 394 deletions(-) diff --git a/Makefile b/Makefile index 131c79a..cf54145 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ init: dart pub get .PHONY: lint -lint: +lint: init dart analyze lib example .PHONY: test @@ -19,7 +19,7 @@ format: dart format . .PHONY: fix -fix: +fix: init dart fix --apply .PHONY: after-gen diff --git a/lib/src/api/barcode_api.dart b/lib/src/api/barcode_api.dart index 3e9cb50..159b981 100644 --- a/lib/src/api/barcode_api.dart +++ b/lib/src/api/barcode_api.dart @@ -6,7 +6,7 @@ import '../../aspose_barcode_cloud.dart'; import '../api_helper.dart'; class BarcodeApi { - BarcodeApi(this.apiClient) {} + BarcodeApi(this.apiClient); final ApiClient apiClient; @@ -49,7 +49,7 @@ class BarcodeApi { bool? useAntiAlias, String? format}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = @@ -257,12 +257,12 @@ class BarcodeApi { String? storage, String? folder}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/{name}/recognize" .replaceAll("{format}", "json") - .replaceAll("{" + "name" + "}", name); + .replaceAll("{name}", name); // query params final List queryParams = []; @@ -487,7 +487,7 @@ class BarcodeApi { String? url, MultipartFile? image}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = @@ -769,12 +769,12 @@ class BarcodeApi { String? folder, String? format}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/{name}/generate" .replaceAll("{format}", "json") - .replaceAll("{" + "name" + "}", name); + .replaceAll("{name}", name); // query params final List queryParams = []; @@ -961,7 +961,7 @@ class BarcodeApi { // create path and map variables final String requestPath = "/barcode/{name}/recognize" .replaceAll("{format}", "json") - .replaceAll("{" + "name" + "}", name); + .replaceAll("{name}", name); // query params final List queryParams = []; @@ -1009,7 +1009,7 @@ class BarcodeApi { // create path and map variables final String requestPath = "/barcode/{name}/generateMultiple" .replaceAll("{format}", "json") - .replaceAll("{" + "name" + "}", name); + .replaceAll("{name}", name); // query params final List queryParams = []; diff --git a/lib/src/api/file_api.dart b/lib/src/api/file_api.dart index ca6c28f..9de4102 100644 --- a/lib/src/api/file_api.dart +++ b/lib/src/api/file_api.dart @@ -6,7 +6,7 @@ import '../../aspose_barcode_cloud.dart'; import '../api_helper.dart'; class FileApi { - FileApi(this.apiClient) {} + FileApi(this.apiClient); final ApiClient apiClient; @@ -18,12 +18,12 @@ class FileApi { String? destStorageName, String? versionId}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/storage/file/copy/{srcPath}" .replaceAll("{format}", "json") - .replaceAll("{" + "srcPath" + "}", srcPath); + .replaceAll("{srcPath}", srcPath); // query params final List queryParams = []; @@ -66,12 +66,12 @@ class FileApi { Future deleteFile(String path, {String? storageName, String? versionId}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/storage/file/{path}" .replaceAll("{format}", "json") - .replaceAll("{" + "path" + "}", path); + .replaceAll("{path}", path); // query params final List queryParams = []; @@ -115,12 +115,12 @@ class FileApi { Future downloadFile(String path, {String? storageName, String? versionId}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/storage/file/{path}" .replaceAll("{format}", "json") - .replaceAll("{" + "path" + "}", path); + .replaceAll("{path}", path); // query params final List queryParams = []; @@ -159,12 +159,12 @@ class FileApi { String? destStorageName, String? versionId}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/storage/file/move/{srcPath}" .replaceAll("{format}", "json") - .replaceAll("{" + "srcPath" + "}", srcPath); + .replaceAll("{srcPath}", srcPath); // query params final List queryParams = []; @@ -207,12 +207,12 @@ class FileApi { Future uploadFile(String path, MultipartFile file, {String? storageName}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/storage/file/{path}" .replaceAll("{format}", "json") - .replaceAll("{" + "path" + "}", path); + .replaceAll("{path}", path); // query params final List queryParams = []; diff --git a/lib/src/api/folder_api.dart b/lib/src/api/folder_api.dart index 73c6f63..2b8050f 100644 --- a/lib/src/api/folder_api.dart +++ b/lib/src/api/folder_api.dart @@ -2,7 +2,7 @@ import '../../aspose_barcode_cloud.dart'; import '../api_helper.dart'; class FolderApi { - FolderApi(this.apiClient) {} + FolderApi(this.apiClient); final ApiClient apiClient; @@ -12,12 +12,12 @@ class FolderApi { Future copyFolder(String srcPath, String destPath, {String? srcStorageName, String? destStorageName}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/storage/folder/copy/{srcPath}" .replaceAll("{format}", "json") - .replaceAll("{" + "srcPath" + "}", srcPath); + .replaceAll("{srcPath}", srcPath); // query params final List queryParams = []; @@ -55,12 +55,12 @@ class FolderApi { /// Future createFolder(String path, {String? storageName}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/storage/folder/{path}" .replaceAll("{format}", "json") - .replaceAll("{" + "path" + "}", path); + .replaceAll("{path}", path); // query params final List queryParams = []; @@ -93,12 +93,12 @@ class FolderApi { Future deleteFolder(String path, {String? storageName, bool? recursive}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/storage/folder/{path}" .replaceAll("{format}", "json") - .replaceAll("{" + "path" + "}", path); + .replaceAll("{path}", path); // query params final List queryParams = []; @@ -141,12 +141,12 @@ class FolderApi { /// Future getFilesList(String path, {String? storageName}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/storage/folder/{path}" .replaceAll("{format}", "json") - .replaceAll("{" + "path" + "}", path); + .replaceAll("{path}", path); // query params final List queryParams = []; @@ -179,12 +179,12 @@ class FolderApi { Future moveFolder(String srcPath, String destPath, {String? srcStorageName, String? destStorageName}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/storage/folder/move/{srcPath}" .replaceAll("{format}", "json") - .replaceAll("{" + "srcPath" + "}", srcPath); + .replaceAll("{srcPath}", srcPath); // query params final List queryParams = []; diff --git a/lib/src/api/storage_api.dart b/lib/src/api/storage_api.dart index 8e2b282..92299b0 100644 --- a/lib/src/api/storage_api.dart +++ b/lib/src/api/storage_api.dart @@ -2,7 +2,7 @@ import '../../aspose_barcode_cloud.dart'; import '../api_helper.dart'; class StorageApi { - StorageApi(this.apiClient) {} + StorageApi(this.apiClient); final ApiClient apiClient; @@ -11,7 +11,7 @@ class StorageApi { /// Future getDiscUsage({String? storageName}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = @@ -48,12 +48,12 @@ class StorageApi { Future getFileVersions(String path, {String? storageName}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/storage/version/{path}" .replaceAll("{format}", "json") - .replaceAll("{" + "path" + "}", path); + .replaceAll("{path}", path); // query params final List queryParams = []; @@ -87,12 +87,12 @@ class StorageApi { Future objectExists(String path, {String? storageName, String? versionId}) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/storage/exist/{path}" .replaceAll("{format}", "json") - .replaceAll("{" + "path" + "}", path); + .replaceAll("{path}", path); // query params final List queryParams = []; @@ -128,12 +128,12 @@ class StorageApi { /// Future storageExists(String storageName) async { // ignore: prefer_final_locals - Object? postBody = null; + Object? postBody; // create path and map variables final String requestPath = "/barcode/storage/{storageName}/exist" .replaceAll("{format}", "json") - .replaceAll("{" + "storageName" + "}", storageName); + .replaceAll("{storageName}", storageName); // query params final List queryParams = []; diff --git a/lib/src/api_client.dart b/lib/src/api_client.dart index bd3b946..aedff09 100644 --- a/lib/src/api_client.dart +++ b/lib/src/api_client.dart @@ -1,3 +1,5 @@ +// ignore_for_file: library_prefixes, constant_identifier_names + import 'dart:convert' show json; import 'package:http/http.dart' as Http show Client, MultipartRequest, Response; @@ -6,7 +8,7 @@ import '../aspose_barcode_cloud.dart'; import 'api_helper.dart'; import 'auth/authentication.dart'; -const String SDK_VERSION = "1.24.2"; +const SDK_VERSION = "1.24.2"; class ApiClient { late final String basePath; @@ -16,7 +18,7 @@ class ApiClient { static const String SDK_NAME = "dart sdk"; static const String API_CLIENT_VERSION_HEADER = "x-aspose-client-version"; - Map _defaultHeaderMap = { + final Map _defaultHeaderMap = { API_SDK_HEADER: SDK_NAME, API_CLIENT_VERSION_HEADER: SDK_VERSION, }; @@ -27,7 +29,7 @@ class ApiClient { final _regMap = RegExp(r'^Map$'); ApiClient(Configuration config) { - this.basePath = config.basePath; + basePath = config.basePath; _authentication = OAuth( clientId: config.clientId, clientSecret: config.clientSecret, @@ -267,7 +269,7 @@ class ApiClient { await _updateParamsForAuth(queryParams, headerParams); final ps = queryParams.map((p) => '${p.name}=${p.value}'); - final String queryString = ps.isNotEmpty ? '?' + ps.join('&') : ''; + final String queryString = ps.isNotEmpty ? '?${ps.join('&')}' : ''; final String url = basePath + path + queryString; diff --git a/lib/src/api_exception.dart b/lib/src/api_exception.dart index a97a75a..a0c53e2 100644 --- a/lib/src/api_exception.dart +++ b/lib/src/api_exception.dart @@ -1,14 +1,15 @@ class ApiException implements Exception { int code = 0; - String? message = null; - Exception? innerException = null; - StackTrace? stackTrace = null; + String? message; + Exception? innerException; + StackTrace? stackTrace; ApiException(this.code, this.message); ApiException.withInner( this.code, this.message, this.innerException, this.stackTrace); + @override String toString() { if (message == null) { return "ApiException"; @@ -18,7 +19,6 @@ class ApiException implements Exception { return "ApiException $code: $message"; } - return "ApiException $code: $message (Inner exception: ${innerException})\n\n" + - stackTrace.toString(); + return "ApiException $code: $message (Inner exception: $innerException)\n\n$stackTrace"; } } diff --git a/lib/src/api_helper.dart b/lib/src/api_helper.dart index eb4407c..fa6a2eb 100644 --- a/lib/src/api_helper.dart +++ b/lib/src/api_helper.dart @@ -1,6 +1,6 @@ import '../aspose_barcode_cloud.dart'; -const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; +const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; class QueryParam { String name; diff --git a/lib/src/auth/oauth.dart b/lib/src/auth/oauth.dart index 0447039..34d9503 100644 --- a/lib/src/auth/oauth.dart +++ b/lib/src/auth/oauth.dart @@ -38,14 +38,14 @@ class OAuth implements Authentication { if (accessToken == null) { throw ApiException(0, "accessToken is null"); } - headerParams["Authorization"] = "Bearer " + accessToken!; + headerParams["Authorization"] = "Bearer ${accessToken!}"; } Future fetchToken() async { final request = MultipartRequest('POST', Uri.parse(tokenUrl)) ..fields['grant_type'] = 'client_credentials' - ..fields['client_id'] = this.clientId! - ..fields['client_secret'] = this.clientSecret!; + ..fields['client_id'] = clientId! + ..fields['client_secret'] = clientSecret!; final response = await request.send(); final responseText = await response.stream.bytesToString(); diff --git a/lib/src/configuration.dart b/lib/src/configuration.dart index 27ecfce..631bd84 100644 --- a/lib/src/configuration.dart +++ b/lib/src/configuration.dart @@ -1,3 +1,5 @@ +// ignore_for_file: constant_identifier_names + import 'dart:convert' show JsonEncoder, jsonDecode; import 'dart:io'; @@ -58,7 +60,7 @@ class Configuration { } static fromEnv({String prefix = ""}) { - final accessToken = Platform.environment[prefix + "ACCESS_TOKEN"]; + final accessToken = Platform.environment["${prefix}ACCESS_TOKEN"]; return Configuration( accessToken: accessToken, ); diff --git a/lib/src/model/api_error.dart b/lib/src/model/api_error.dart index 915e084..58cfcdf 100644 --- a/lib/src/model/api_error.dart +++ b/lib/src/model/api_error.dart @@ -2,15 +2,15 @@ // ignore_for_file: deprecated_member_use_from_same_package class ApiError { - String? code = null; + String? code; - String? message = null; + String? message; - String? description = null; + String? description; - DateTime? dateTime = null; + DateTime? dateTime; - ApiError? innerError = null; + ApiError? innerError; ApiError(); @@ -44,7 +44,7 @@ class ApiError { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = ApiError.fromJson(value)); diff --git a/lib/src/model/api_error_response.dart b/lib/src/model/api_error_response.dart index d031af9..23e7752 100644 --- a/lib/src/model/api_error_response.dart +++ b/lib/src/model/api_error_response.dart @@ -3,9 +3,9 @@ import '../../aspose_barcode_cloud.dart'; class ApiErrorResponse { - String? requestId = null; + String? requestId; - ApiError? error = null; + ApiError? error; ApiErrorResponse(); @@ -29,7 +29,7 @@ class ApiErrorResponse { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = ApiErrorResponse.fromJson(value)); diff --git a/lib/src/model/australian_post_params.dart b/lib/src/model/australian_post_params.dart index e25ec78..7af4953 100644 --- a/lib/src/model/australian_post_params.dart +++ b/lib/src/model/australian_post_params.dart @@ -4,10 +4,10 @@ import '../../aspose_barcode_cloud.dart'; class AustralianPostParams { /* Interpreting type for the Customer Information of AustralianPost, default to CustomerInformationInterpretingType.Other\" */ - CustomerInformationInterpretingType? encodingTable = null; + CustomerInformationInterpretingType? encodingTable; /* Short bar's height of AustralianPost barcode. */ - double? shortBarHeight = null; + double? shortBarHeight; AustralianPostParams(); @@ -19,9 +19,7 @@ class AustralianPostParams { AustralianPostParams.fromJson(Map json) { encodingTable = CustomerInformationInterpretingType.fromJson(json['encodingTable']); - shortBarHeight = json['shortBarHeight'] == null - ? null - : json['shortBarHeight'].toDouble(); + shortBarHeight = json['shortBarHeight']?.toDouble(); } Map toJson() { @@ -34,7 +32,7 @@ class AustralianPostParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = AustralianPostParams.fromJson(value)); diff --git a/lib/src/model/auto_size_mode.dart b/lib/src/model/auto_size_mode.dart index 8805cc1..597dfce 100644 --- a/lib/src/model/auto_size_mode.dart +++ b/lib/src/model/auto_size_mode.dart @@ -37,6 +37,7 @@ class AutoSizeMode { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/available_graphics_unit.dart b/lib/src/model/available_graphics_unit.dart index 65587d3..f1950d2 100644 --- a/lib/src/model/available_graphics_unit.dart +++ b/lib/src/model/available_graphics_unit.dart @@ -46,6 +46,7 @@ class AvailableGraphicsUnit { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/aztec_encode_mode.dart b/lib/src/model/aztec_encode_mode.dart index 0820e6a..ba30df0 100644 --- a/lib/src/model/aztec_encode_mode.dart +++ b/lib/src/model/aztec_encode_mode.dart @@ -38,6 +38,7 @@ class AztecEncodeMode { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/aztec_params.dart b/lib/src/model/aztec_params.dart index 297dc01..a8f927d 100644 --- a/lib/src/model/aztec_params.dart +++ b/lib/src/model/aztec_params.dart @@ -4,30 +4,30 @@ import '../../aspose_barcode_cloud.dart'; class AztecParams { /* Height/Width ratio of 2D BarCode module. */ - double? aspectRatio = null; + double? aspectRatio; /* Level of error correction of Aztec types of barcode. Value should between 10 to 95. */ - int? errorLevel = null; + int? errorLevel; /* Aztec Symbol mode. Default value: AztecSymbolMode.Auto. */ - AztecSymbolMode? symbolMode = null; + AztecSymbolMode? symbolMode; /* DEPRECATED: This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. */ @Deprecated( "This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. ") - String? textEncoding = null; + String? textEncoding; /* Encoding mode for Aztec barcodes. Default value: Auto */ - AztecEncodeMode? encodeMode = null; + AztecEncodeMode? encodeMode; /* Identifies ECI encoding. Used when AztecEncodeMode is Auto. Default value: ISO-8859-1. */ - ECIEncodings? eCIEncoding = null; + ECIEncodings? eCIEncoding; /* Used to instruct the reader to interpret the data contained within the symbol as programming for reader initialization. */ - bool? isReaderInitialization = null; + bool? isReaderInitialization; /* Gets or sets layers count of Aztec symbol. Layers count should be in range from 1 to 3 for Compact mode and in range from 1 to 32 for Full Range mode. Default value: 0 (auto). */ - int? layersCount = null; + int? layersCount; AztecParams(); @@ -37,8 +37,7 @@ class AztecParams { } AztecParams.fromJson(Map json) { - aspectRatio = - json['aspectRatio'] == null ? null : json['aspectRatio'].toDouble(); + aspectRatio = json['aspectRatio']?.toDouble(); errorLevel = json['errorLevel']; symbolMode = AztecSymbolMode.fromJson(json['symbolMode']); textEncoding = json['textEncoding']; @@ -67,7 +66,7 @@ class AztecParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = AztecParams.fromJson(value)); diff --git a/lib/src/model/aztec_symbol_mode.dart b/lib/src/model/aztec_symbol_mode.dart index 598e55f..e0b2a27 100644 --- a/lib/src/model/aztec_symbol_mode.dart +++ b/lib/src/model/aztec_symbol_mode.dart @@ -43,6 +43,7 @@ class AztecSymbolMode { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/barcode_response.dart b/lib/src/model/barcode_response.dart index a08b371..69f4ea9 100644 --- a/lib/src/model/barcode_response.dart +++ b/lib/src/model/barcode_response.dart @@ -4,16 +4,16 @@ import '../../aspose_barcode_cloud.dart'; class BarcodeResponse { /* Barcode data. */ - String? barcodeValue = null; + String? barcodeValue; /* Type of the barcode. */ - String? type = null; + String? type; /* Region with barcode. */ List? region = []; /* Checksum of barcode. */ - String? checksum = null; + String? checksum; BarcodeResponse(); @@ -44,7 +44,7 @@ class BarcodeResponse { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = BarcodeResponse.fromJson(value)); diff --git a/lib/src/model/barcode_response_list.dart b/lib/src/model/barcode_response_list.dart index 5e16700..e85eef5 100644 --- a/lib/src/model/barcode_response_list.dart +++ b/lib/src/model/barcode_response_list.dart @@ -27,7 +27,7 @@ class BarcodeResponseList { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = BarcodeResponseList.fromJson(value)); diff --git a/lib/src/model/border_dash_style.dart b/lib/src/model/border_dash_style.dart index b17f0b4..4194d9e 100644 --- a/lib/src/model/border_dash_style.dart +++ b/lib/src/model/border_dash_style.dart @@ -49,6 +49,7 @@ class BorderDashStyle { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/caption_params.dart b/lib/src/model/caption_params.dart index f8d33f4..4987589 100644 --- a/lib/src/model/caption_params.dart +++ b/lib/src/model/caption_params.dart @@ -4,25 +4,25 @@ import '../../aspose_barcode_cloud.dart'; class CaptionParams { /* Caption text. */ - String? text = null; + String? text; /* Text alignment. */ - TextAlignment? alignment = null; + TextAlignment? alignment; /* Text color. */ - String? color = null; + String? color; /* Is caption visible. */ - bool? visible = null; + bool? visible; /* Font. */ - FontParams? font = null; + FontParams? font; /* Padding. */ - Padding? padding = null; + Padding? padding; /* Specify word wraps (line breaks) within text. Default value: false. */ - bool? noWrap = null; + bool? noWrap; CaptionParams(); @@ -59,7 +59,7 @@ class CaptionParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = CaptionParams.fromJson(value)); diff --git a/lib/src/model/checksum_validation.dart b/lib/src/model/checksum_validation.dart index 38351bc..8fe08cd 100644 --- a/lib/src/model/checksum_validation.dart +++ b/lib/src/model/checksum_validation.dart @@ -37,6 +37,7 @@ class ChecksumValidation { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/codabar_checksum_mode.dart b/lib/src/model/codabar_checksum_mode.dart index a15f35f..f0e5339 100644 --- a/lib/src/model/codabar_checksum_mode.dart +++ b/lib/src/model/codabar_checksum_mode.dart @@ -31,6 +31,7 @@ class CodabarChecksumMode { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/codabar_params.dart b/lib/src/model/codabar_params.dart index 20116d6..cf5ce5e 100644 --- a/lib/src/model/codabar_params.dart +++ b/lib/src/model/codabar_params.dart @@ -4,13 +4,13 @@ import '../../aspose_barcode_cloud.dart'; class CodabarParams { /* Checksum algorithm for Codabar barcodes. Default value: CodabarChecksumMode.Mod16. To enable checksum calculation set value EnableChecksum.Yes to property EnableChecksum. */ - CodabarChecksumMode? checksumMode = null; + CodabarChecksumMode? checksumMode; /* Start symbol (character) of Codabar symbology. Default value: CodabarSymbol.A */ - CodabarSymbol? startSymbol = null; + CodabarSymbol? startSymbol; /* Stop symbol (character) of Codabar symbology. Default value: CodabarSymbol.A */ - CodabarSymbol? stopSymbol = null; + CodabarSymbol? stopSymbol; CodabarParams(); @@ -39,7 +39,7 @@ class CodabarParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = CodabarParams.fromJson(value)); diff --git a/lib/src/model/codabar_symbol.dart b/lib/src/model/codabar_symbol.dart index e99e48d..1d03a91 100644 --- a/lib/src/model/codabar_symbol.dart +++ b/lib/src/model/codabar_symbol.dart @@ -43,6 +43,7 @@ class CodabarSymbol { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/codablock_params.dart b/lib/src/model/codablock_params.dart index c5ba3f9..e971bf2 100644 --- a/lib/src/model/codablock_params.dart +++ b/lib/src/model/codablock_params.dart @@ -3,13 +3,13 @@ class CodablockParams { /* Height/Width ratio of 2D BarCode module. */ - double? aspectRatio = null; + double? aspectRatio; /* Columns count. */ - int? columns = null; + int? columns; /* Rows count. */ - int? rows = null; + int? rows; CodablockParams(); @@ -19,8 +19,7 @@ class CodablockParams { } CodablockParams.fromJson(Map json) { - aspectRatio = - json['aspectRatio'] == null ? null : json['aspectRatio'].toDouble(); + aspectRatio = json['aspectRatio']?.toDouble(); columns = json['columns']; rows = json['rows']; } @@ -35,7 +34,7 @@ class CodablockParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = CodablockParams.fromJson(value)); diff --git a/lib/src/model/code128_emulation.dart b/lib/src/model/code128_emulation.dart index e41e1bd..79ee791 100644 --- a/lib/src/model/code128_emulation.dart +++ b/lib/src/model/code128_emulation.dart @@ -43,6 +43,7 @@ class Code128Emulation { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/code128_encode_mode.dart b/lib/src/model/code128_encode_mode.dart index f8860ec..926a392 100644 --- a/lib/src/model/code128_encode_mode.dart +++ b/lib/src/model/code128_encode_mode.dart @@ -61,6 +61,7 @@ class Code128EncodeMode { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/code128_params.dart b/lib/src/model/code128_params.dart index a122961..81c151c 100644 --- a/lib/src/model/code128_params.dart +++ b/lib/src/model/code128_params.dart @@ -4,7 +4,7 @@ import '../../aspose_barcode_cloud.dart'; class Code128Params { /* Encoding mode for Code128 barcodes. Code 128 specification Default value: Code128EncodeMode.Auto. */ - Code128EncodeMode? encodeMode = null; + Code128EncodeMode? encodeMode; Code128Params(); @@ -27,7 +27,7 @@ class Code128Params { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = Code128Params.fromJson(value)); diff --git a/lib/src/model/code16_k_params.dart b/lib/src/model/code16_k_params.dart index 5f23d64..e7febb6 100644 --- a/lib/src/model/code16_k_params.dart +++ b/lib/src/model/code16_k_params.dart @@ -3,13 +3,13 @@ class Code16KParams { /* Height/Width ratio of 2D BarCode module. */ - double? aspectRatio = null; + double? aspectRatio; /* Size of the left quiet zone in xDimension. Default value: 10, meaning if xDimension = 2px than left quiet zone will be 20px. */ - int? quietZoneLeftCoef = null; + int? quietZoneLeftCoef; /* Size of the right quiet zone in xDimension. Default value: 1, meaning if xDimension = 2px than right quiet zone will be 2px. */ - int? quietZoneRightCoef = null; + int? quietZoneRightCoef; Code16KParams(); @@ -19,8 +19,7 @@ class Code16KParams { } Code16KParams.fromJson(Map json) { - aspectRatio = - json['aspectRatio'] == null ? null : json['aspectRatio'].toDouble(); + aspectRatio = json['aspectRatio']?.toDouble(); quietZoneLeftCoef = json['quietZoneLeftCoef']; quietZoneRightCoef = json['quietZoneRightCoef']; } @@ -39,7 +38,7 @@ class Code16KParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = Code16KParams.fromJson(value)); diff --git a/lib/src/model/code_location.dart b/lib/src/model/code_location.dart index ecc4cea..38e6416 100644 --- a/lib/src/model/code_location.dart +++ b/lib/src/model/code_location.dart @@ -37,6 +37,7 @@ class CodeLocation { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/coupon_params.dart b/lib/src/model/coupon_params.dart index 43994c0..ac0a360 100644 --- a/lib/src/model/coupon_params.dart +++ b/lib/src/model/coupon_params.dart @@ -3,7 +3,7 @@ class CouponParams { /* Space between main the BarCode and supplement BarCode in Unit value. */ - double? supplementSpace = null; + double? supplementSpace; CouponParams(); @@ -13,9 +13,7 @@ class CouponParams { } CouponParams.fromJson(Map json) { - supplementSpace = json['supplementSpace'] == null - ? null - : json['supplementSpace'].toDouble(); + supplementSpace = json['supplementSpace']?.toDouble(); } Map toJson() { @@ -28,7 +26,7 @@ class CouponParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = CouponParams.fromJson(value)); diff --git a/lib/src/model/customer_information_interpreting_type.dart b/lib/src/model/customer_information_interpreting_type.dart index 83f417c..7072bab 100644 --- a/lib/src/model/customer_information_interpreting_type.dart +++ b/lib/src/model/customer_information_interpreting_type.dart @@ -40,6 +40,7 @@ class CustomerInformationInterpretingType { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/data_bar_params.dart b/lib/src/model/data_bar_params.dart index 95c6e20..cde1781 100644 --- a/lib/src/model/data_bar_params.dart +++ b/lib/src/model/data_bar_params.dart @@ -3,19 +3,19 @@ class DataBarParams { /* Height/Width ratio of 2D BarCode module. Used for DataBar stacked. */ - double? aspectRatio = null; + double? aspectRatio; /* Columns count. */ - int? columns = null; + int? columns; /* Rows count. */ - int? rows = null; + int? rows; /* Enables flag of 2D composite component with DataBar barcode */ - bool? is2DCompositeComponent = null; + bool? is2DCompositeComponent; /* If this flag is set, it allows only GS1 encoding standard for Databar barcode types */ - bool? isAllowOnlyGS1Encoding = null; + bool? isAllowOnlyGS1Encoding; DataBarParams(); @@ -25,8 +25,7 @@ class DataBarParams { } DataBarParams.fromJson(Map json) { - aspectRatio = - json['aspectRatio'] == null ? null : json['aspectRatio'].toDouble(); + aspectRatio = json['aspectRatio']?.toDouble(); columns = json['columns']; rows = json['rows']; is2DCompositeComponent = json['is2DCompositeComponent']; @@ -49,7 +48,7 @@ class DataBarParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = DataBarParams.fromJson(value)); diff --git a/lib/src/model/data_matrix_ecc_type.dart b/lib/src/model/data_matrix_ecc_type.dart index b003a86..0480556 100644 --- a/lib/src/model/data_matrix_ecc_type.dart +++ b/lib/src/model/data_matrix_ecc_type.dart @@ -61,6 +61,7 @@ class DataMatrixEccType { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/data_matrix_encode_mode.dart b/lib/src/model/data_matrix_encode_mode.dart index 42d58a1..0a653d5 100644 --- a/lib/src/model/data_matrix_encode_mode.dart +++ b/lib/src/model/data_matrix_encode_mode.dart @@ -77,6 +77,7 @@ class DataMatrixEncodeMode { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/data_matrix_params.dart b/lib/src/model/data_matrix_params.dart index 49e1033..171f9fc 100644 --- a/lib/src/model/data_matrix_params.dart +++ b/lib/src/model/data_matrix_params.dart @@ -4,34 +4,34 @@ import '../../aspose_barcode_cloud.dart'; class DataMatrixParams { /* Height/Width ratio of 2D BarCode module */ - double? aspectRatio = null; + double? aspectRatio; /* DEPRECATED: This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. */ @Deprecated( "This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. ") - String? textEncoding = null; + String? textEncoding; /* DEPRECATED: Will be replaced with 'DataMatrix.Version' in the next release Columns count. */ @Deprecated( "Will be replaced with 'DataMatrix.Version' in the next release Columns count. ") - int? columns = null; + int? columns; /* Datamatrix ECC type. Default value: DataMatrixEccType.Ecc200. */ - DataMatrixEccType? dataMatrixEcc = null; + DataMatrixEccType? dataMatrixEcc; /* Encode mode of Datamatrix barcode. Default value: DataMatrixEncodeMode.Auto. */ - DataMatrixEncodeMode? dataMatrixEncodeMode = null; + DataMatrixEncodeMode? dataMatrixEncodeMode; /* DEPRECATED: Will be replaced with 'DataMatrix.Version' in the next release Rows count. */ @Deprecated( "Will be replaced with 'DataMatrix.Version' in the next release Rows count. ") - int? rows = null; + int? rows; /* Macro Characters 05 and 06 values are used to obtain more compact encoding in special modes. Can be used only with DataMatrixEccType.Ecc200 or DataMatrixEccType.EccAuto. Cannot be used with EncodeTypes.GS1DataMatrix Default value: MacroCharacters.None. */ - MacroCharacter? macroCharacters = null; + MacroCharacter? macroCharacters; /* Sets a Datamatrix symbol size. Default value: DataMatrixVersion.Auto. */ - DataMatrixVersion? version = null; + DataMatrixVersion? version; DataMatrixParams(); @@ -41,8 +41,7 @@ class DataMatrixParams { } DataMatrixParams.fromJson(Map json) { - aspectRatio = - json['aspectRatio'] == null ? null : json['aspectRatio'].toDouble(); + aspectRatio = json['aspectRatio']?.toDouble(); textEncoding = json['textEncoding']; columns = json['columns']; dataMatrixEcc = DataMatrixEccType.fromJson(json['dataMatrixEcc']); @@ -72,7 +71,7 @@ class DataMatrixParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = DataMatrixParams.fromJson(value)); diff --git a/lib/src/model/data_matrix_version.dart b/lib/src/model/data_matrix_version.dart index 8287b86..2996841 100644 --- a/lib/src/model/data_matrix_version.dart +++ b/lib/src/model/data_matrix_version.dart @@ -511,6 +511,7 @@ class DataMatrixVersion { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/decode_barcode_type.dart b/lib/src/model/decode_barcode_type.dart index 1eb3303..e507d87 100644 --- a/lib/src/model/decode_barcode_type.dart +++ b/lib/src/model/decode_barcode_type.dart @@ -575,6 +575,7 @@ class DecodeBarcodeType { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/disc_usage.dart b/lib/src/model/disc_usage.dart index dc47b6d..e78e04f 100644 --- a/lib/src/model/disc_usage.dart +++ b/lib/src/model/disc_usage.dart @@ -3,10 +3,10 @@ class DiscUsage { /* Application used disc space. */ - int? usedSize = null; + int? usedSize; /* Total disc space. */ - int? totalSize = null; + int? totalSize; DiscUsage(); @@ -30,7 +30,7 @@ class DiscUsage { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = DiscUsage.fromJson(value)); diff --git a/lib/src/model/dot_code_encode_mode.dart b/lib/src/model/dot_code_encode_mode.dart index 152c521..5d43366 100644 --- a/lib/src/model/dot_code_encode_mode.dart +++ b/lib/src/model/dot_code_encode_mode.dart @@ -38,6 +38,7 @@ class DotCodeEncodeMode { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/dot_code_params.dart b/lib/src/model/dot_code_params.dart index 464064d..b881529 100644 --- a/lib/src/model/dot_code_params.dart +++ b/lib/src/model/dot_code_params.dart @@ -4,22 +4,22 @@ import '../../aspose_barcode_cloud.dart'; class DotCodeParams { /* Height/Width ratio of 2D BarCode module. */ - double? aspectRatio = null; + double? aspectRatio; /* Identifies columns count. Sum of the number of rows plus the number of columns of a DotCode symbol must be odd. Number of columns must be at least 5. */ - int? columns = null; + int? columns; /* Identifies DotCode encode mode. Default value: Auto. */ - DotCodeEncodeMode? encodeMode = null; + DotCodeEncodeMode? encodeMode; /* Identifies ECI encoding. Used when DotCodeEncodeMode is Auto. Default value: ISO-8859-1. */ - ECIEncodings? eCIEncoding = null; + ECIEncodings? eCIEncoding; /* Indicates whether code is used for instruct reader to interpret the following data as instructions for initialization or reprogramming of the bar code reader. Default value is false. */ - bool? isReaderInitialization = null; + bool? isReaderInitialization; /* Identifies rows count. Sum of the number of rows plus the number of columns of a DotCode symbol must be odd. Number of rows must be at least 5. */ - int? rows = null; + int? rows; DotCodeParams(); @@ -29,8 +29,7 @@ class DotCodeParams { } DotCodeParams.fromJson(Map json) { - aspectRatio = - json['aspectRatio'] == null ? null : json['aspectRatio'].toDouble(); + aspectRatio = json['aspectRatio']?.toDouble(); columns = json['columns']; encodeMode = DotCodeEncodeMode.fromJson(json['encodeMode']); eCIEncoding = ECIEncodings.fromJson(json['eCIEncoding']); @@ -55,7 +54,7 @@ class DotCodeParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = DotCodeParams.fromJson(value)); diff --git a/lib/src/model/eci_encodings.dart b/lib/src/model/eci_encodings.dart index 439e815..cc583c1 100644 --- a/lib/src/model/eci_encodings.dart +++ b/lib/src/model/eci_encodings.dart @@ -181,6 +181,7 @@ class ECIEncodings { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/enable_checksum.dart b/lib/src/model/enable_checksum.dart index 4e559d8..5eea9c6 100644 --- a/lib/src/model/enable_checksum.dart +++ b/lib/src/model/enable_checksum.dart @@ -37,6 +37,7 @@ class EnableChecksum { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/encode_barcode_type.dart b/lib/src/model/encode_barcode_type.dart index e83724b..4538dd5 100644 --- a/lib/src/model/encode_barcode_type.dart +++ b/lib/src/model/encode_barcode_type.dart @@ -487,6 +487,7 @@ class EncodeBarcodeType { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/error.dart b/lib/src/model/error.dart index c91de54..379eaad 100644 --- a/lib/src/model/error.dart +++ b/lib/src/model/error.dart @@ -4,16 +4,16 @@ import '../../aspose_barcode_cloud.dart'; class Error { /* Code */ - String? code = null; + String? code; /* Message */ - String? message = null; + String? message; /* Description */ - String? description = null; + String? description; /* Inner Error */ - ErrorDetails? innerError = null; + ErrorDetails? innerError; Error(); @@ -44,7 +44,7 @@ class Error { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = Error.fromJson(value)); diff --git a/lib/src/model/error_details.dart b/lib/src/model/error_details.dart index c0282c2..ec2a7a8 100644 --- a/lib/src/model/error_details.dart +++ b/lib/src/model/error_details.dart @@ -3,10 +3,10 @@ class ErrorDetails { /* The request id */ - String? requestId = null; + String? requestId; /* Date */ - DateTime? date = null; + DateTime? date; ErrorDetails(); @@ -33,7 +33,7 @@ class ErrorDetails { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = ErrorDetails.fromJson(value)); diff --git a/lib/src/model/file_version.dart b/lib/src/model/file_version.dart index e75eecc..239a6da 100644 --- a/lib/src/model/file_version.dart +++ b/lib/src/model/file_version.dart @@ -3,25 +3,25 @@ class FileVersion { /* File or folder name. */ - String? name = null; + String? name; /* True if it is a folder. */ - bool? isFolder = null; + bool? isFolder; /* File or folder last modified DateTime. */ - DateTime? modifiedDate = null; + DateTime? modifiedDate; /* File or folder size. */ - int? size = null; + int? size; /* File or folder path. */ - String? path = null; + String? path; /* File Version ID. */ - String? versionId = null; + String? versionId; /* Specifies whether the file is (true) or is not (false) the latest version of an file. */ - bool? isLatest = null; + bool? isLatest; FileVersion(); @@ -61,7 +61,7 @@ class FileVersion { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = FileVersion.fromJson(value)); diff --git a/lib/src/model/file_versions.dart b/lib/src/model/file_versions.dart index eecefc3..7da4ab0 100644 --- a/lib/src/model/file_versions.dart +++ b/lib/src/model/file_versions.dart @@ -27,7 +27,7 @@ class FileVersions { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = FileVersions.fromJson(value)); diff --git a/lib/src/model/files_list.dart b/lib/src/model/files_list.dart index 3120bd1..fdb4b46 100644 --- a/lib/src/model/files_list.dart +++ b/lib/src/model/files_list.dart @@ -27,7 +27,7 @@ class FilesList { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = FilesList.fromJson(value)); diff --git a/lib/src/model/files_upload_result.dart b/lib/src/model/files_upload_result.dart index 052eb44..dfcd4e6 100644 --- a/lib/src/model/files_upload_result.dart +++ b/lib/src/model/files_upload_result.dart @@ -32,7 +32,7 @@ class FilesUploadResult { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = FilesUploadResult.fromJson(value)); diff --git a/lib/src/model/font_mode.dart b/lib/src/model/font_mode.dart index f300042..fb836c6 100644 --- a/lib/src/model/font_mode.dart +++ b/lib/src/model/font_mode.dart @@ -31,6 +31,7 @@ class FontMode { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/font_params.dart b/lib/src/model/font_params.dart index e248723..02d84a3 100644 --- a/lib/src/model/font_params.dart +++ b/lib/src/model/font_params.dart @@ -4,13 +4,13 @@ import '../../aspose_barcode_cloud.dart'; class FontParams { /* Font family. */ - String? family = null; + String? family; /* Font size in units. */ - double? size = null; + double? size; /* Font style. */ - FontStyle? style = null; + FontStyle? style; FontParams(); @@ -21,7 +21,7 @@ class FontParams { FontParams.fromJson(Map json) { family = json['family']; - size = json['size'] == null ? null : json['size'].toDouble(); + size = json['size']?.toDouble(); style = FontStyle.fromJson(json['style']); } @@ -35,7 +35,7 @@ class FontParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = FontParams.fromJson(value)); diff --git a/lib/src/model/font_style.dart b/lib/src/model/font_style.dart index 541d095..48f4e3a 100644 --- a/lib/src/model/font_style.dart +++ b/lib/src/model/font_style.dart @@ -49,6 +49,7 @@ class FontStyle { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/generator_params.dart b/lib/src/model/generator_params.dart index d306a4c..9fd95ca 100644 --- a/lib/src/model/generator_params.dart +++ b/lib/src/model/generator_params.dart @@ -4,174 +4,174 @@ import '../../aspose_barcode_cloud.dart'; class GeneratorParams { /* Type of barcode to generate. */ - EncodeBarcodeType? typeOfBarcode = null; + EncodeBarcodeType? typeOfBarcode; /* Text to encode. */ - String? text = null; + String? text; /* Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode */ - String? twoDDisplayText = null; + String? twoDDisplayText; /* Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. */ - CodeLocation? textLocation = null; + CodeLocation? textLocation; /* Text alignment. */ - TextAlignment? textAlignment = null; + TextAlignment? textAlignment; /* Specify the displaying CodeText's Color. Default value: Color.Black. */ - String? textColor = null; + String? textColor; /* Specify the displaying Text's font. Default value: Arial 5pt regular. Ignored if FontSizeMode is set to FontSizeMode.Auto. */ - FontParams? font = null; + FontParams? font; /* Specify FontSizeMode. If FontSizeMode is set to Auto, font size will be calculated automatically based on xDimension value. It is recommended to use FontSizeMode.Auto especially in AutoSizeMode.Nearest or AutoSizeMode.Interpolation. Default value: FontSizeMode.Auto. */ - FontMode? fontSizeMode = null; + FontMode? fontSizeMode; /* Specify word wraps (line breaks) within text. Default value: false. */ - bool? noWrap = null; + bool? noWrap; /* Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. */ - double? resolution = null; + double? resolution; /* DEPRECATED: Use 'Resolution' instead. */ @Deprecated("Use 'Resolution' instead. ") - double? resolutionX = null; + double? resolutionX; /* DEPRECATED: Use 'Resolution' instead. */ @Deprecated("Use 'Resolution' instead. ") - double? resolutionY = null; + double? resolutionY; /* The smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width. Ignored if AutoSizeMode property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation. */ - double? dimensionX = null; + double? dimensionX; /* Space between the CodeText and the BarCode in Unit value. Default value: 2pt. Ignored for EAN8, EAN13, UPCE, UPCA, ISBN, ISMN, ISSN, UpcaGs1DatabarCoupon. */ - double? textSpace = null; + double? textSpace; /* Common Units for all measuring in query. Default units: pixel. */ - AvailableGraphicsUnit? units = null; + AvailableGraphicsUnit? units; /* Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.None. */ - AutoSizeMode? sizeMode = null; + AutoSizeMode? sizeMode; /* Height of the barcode in given units. Default units: pixel. */ - double? barHeight = null; + double? barHeight; /* Height of the barcode image in given units. Default units: pixel. */ - double? imageHeight = null; + double? imageHeight; /* Width of the barcode image in given units. Default units: pixel. */ - double? imageWidth = null; + double? imageWidth; /* BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. */ - double? rotationAngle = null; + double? rotationAngle; /* Barcode paddings. Default value: 5pt 5pt 5pt 5pt. */ - Padding? padding = null; + Padding? padding; /* Additional caption above barcode. */ - CaptionParams? captionAbove = null; + CaptionParams? captionAbove; /* Additional caption below barcode. */ - CaptionParams? captionBelow = null; + CaptionParams? captionBelow; /* Background color of the barcode image. Default value: Color.White. */ - String? backColor = null; + String? backColor; /* Bars color. Default value: Color.Black. */ - String? barColor = null; + String? barColor; /* Border color. Default value: Color.Black. */ - String? borderColor = null; + String? borderColor; /* Border width. Default value: 0. Ignored if Visible is set to false. */ - double? borderWidth = null; + double? borderWidth; /* Border dash style. Default value: BorderDashStyle.Solid. */ - BorderDashStyle? borderDashStyle = null; + BorderDashStyle? borderDashStyle; /* Border visibility. If false than parameter Width is always ignored (0). Default value: false. */ - bool? borderVisible = null; + bool? borderVisible; /* Enable checksum during generation 1D barcodes. Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible. Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar Checksum always used: Rest symbology */ - EnableChecksum? enableChecksum = null; + EnableChecksum? enableChecksum; /* Indicates whether explains the character \"\\\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, \"\\\" will be explained as a special escape character. Otherwise, \"\\\" acts as normal characters. Aspose.BarCode supports input decimal ascii code and mnemonic for ASCII control-code characters. For example, \\013 and \\\\CR stands for CR. */ - bool? enableEscape = null; + bool? enableEscape; /* Value indicating whether bars are filled. Only for 1D barcodes. Default value: true. */ - bool? filledBars = null; + bool? filledBars; /* Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes. */ - bool? alwaysShowChecksum = null; + bool? alwaysShowChecksum; /* Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard */ - double? wideNarrowRatio = null; + double? wideNarrowRatio; /* Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingaporePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect. */ - bool? validateText = null; + bool? validateText; /* Supplement parameters. Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN. */ - String? supplementData = null; + String? supplementData; /* Space between main the BarCode and supplement BarCode. */ - double? supplementSpace = null; + double? supplementSpace; /* Bars reduction value that is used to compensate ink spread while printing. */ - double? barWidthReduction = null; + double? barWidthReduction; /* Indicates whether is used anti-aliasing mode to render image. Anti-aliasing mode is applied to barcode and text drawing. */ - bool? useAntiAlias = null; + bool? useAntiAlias; /* AustralianPost params. */ - AustralianPostParams? australianPost = null; + AustralianPostParams? australianPost; /* Aztec params. */ - AztecParams? aztec = null; + AztecParams? aztec; /* Codabar params. */ - CodabarParams? codabar = null; + CodabarParams? codabar; /* Codablock params. */ - CodablockParams? codablock = null; + CodablockParams? codablock; /* Code16K params. */ - Code16KParams? code16K = null; + Code16KParams? code16K; /* Coupon params. */ - CouponParams? coupon = null; + CouponParams? coupon; /* DataBar params. */ - DataBarParams? dataBar = null; + DataBarParams? dataBar; /* DataMatrix params. */ - DataMatrixParams? dataMatrix = null; + DataMatrixParams? dataMatrix; /* DotCode params. */ - DotCodeParams? dotCode = null; + DotCodeParams? dotCode; /* ITF params. */ - ITFParams? ITF = null; + ITFParams? ITF; /* MaxiCode params. */ - MaxiCodeParams? maxiCode = null; + MaxiCodeParams? maxiCode; /* Pdf417 params. */ - Pdf417Params? pdf417 = null; + Pdf417Params? pdf417; /* Postal params. */ - PostalParams? postal = null; + PostalParams? postal; /* QR params. */ - QrParams? QR = null; + QrParams? QR; /* PatchCode params. */ - PatchCodeParams? patchCode = null; + PatchCodeParams? patchCode; /* Code128 params. */ - Code128Params? code128 = null; + Code128Params? code128; /* HanXin params. */ - HanXinParams? hanXin = null; + HanXinParams? hanXin; GeneratorParams(); @@ -190,49 +190,35 @@ class GeneratorParams { font = FontParams.fromJson(json['font']); fontSizeMode = FontMode.fromJson(json['fontSizeMode']); noWrap = json['noWrap']; - resolution = - json['resolution'] == null ? null : json['resolution'].toDouble(); - resolutionX = - json['resolutionX'] == null ? null : json['resolutionX'].toDouble(); - resolutionY = - json['resolutionY'] == null ? null : json['resolutionY'].toDouble(); - dimensionX = - json['dimensionX'] == null ? null : json['dimensionX'].toDouble(); - textSpace = json['textSpace'] == null ? null : json['textSpace'].toDouble(); + resolution = json['resolution']?.toDouble(); + resolutionX = json['resolutionX']?.toDouble(); + resolutionY = json['resolutionY']?.toDouble(); + dimensionX = json['dimensionX']?.toDouble(); + textSpace = json['textSpace']?.toDouble(); units = AvailableGraphicsUnit.fromJson(json['units']); sizeMode = AutoSizeMode.fromJson(json['sizeMode']); - barHeight = json['barHeight'] == null ? null : json['barHeight'].toDouble(); - imageHeight = - json['imageHeight'] == null ? null : json['imageHeight'].toDouble(); - imageWidth = - json['imageWidth'] == null ? null : json['imageWidth'].toDouble(); - rotationAngle = - json['rotationAngle'] == null ? null : json['rotationAngle'].toDouble(); + barHeight = json['barHeight']?.toDouble(); + imageHeight = json['imageHeight']?.toDouble(); + imageWidth = json['imageWidth']?.toDouble(); + rotationAngle = json['rotationAngle']?.toDouble(); padding = Padding.fromJson(json['padding']); captionAbove = CaptionParams.fromJson(json['captionAbove']); captionBelow = CaptionParams.fromJson(json['captionBelow']); backColor = json['backColor']; barColor = json['barColor']; borderColor = json['borderColor']; - borderWidth = - json['borderWidth'] == null ? null : json['borderWidth'].toDouble(); + borderWidth = json['borderWidth']?.toDouble(); borderDashStyle = BorderDashStyle.fromJson(json['borderDashStyle']); borderVisible = json['borderVisible']; enableChecksum = EnableChecksum.fromJson(json['enableChecksum']); enableEscape = json['enableEscape']; filledBars = json['filledBars']; alwaysShowChecksum = json['alwaysShowChecksum']; - wideNarrowRatio = json['wideNarrowRatio'] == null - ? null - : json['wideNarrowRatio'].toDouble(); + wideNarrowRatio = json['wideNarrowRatio']?.toDouble(); validateText = json['validateText']; supplementData = json['supplementData']; - supplementSpace = json['supplementSpace'] == null - ? null - : json['supplementSpace'].toDouble(); - barWidthReduction = json['barWidthReduction'] == null - ? null - : json['barWidthReduction'].toDouble(); + supplementSpace = json['supplementSpace']?.toDouble(); + barWidthReduction = json['barWidthReduction']?.toDouble(); useAntiAlias = json['useAntiAlias']; australianPost = AustralianPostParams.fromJson(json['australianPost']); aztec = AztecParams.fromJson(json['aztec']); @@ -320,7 +306,7 @@ class GeneratorParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = GeneratorParams.fromJson(value)); diff --git a/lib/src/model/generator_params_list.dart b/lib/src/model/generator_params_list.dart index cc32e49..d14aa10 100644 --- a/lib/src/model/generator_params_list.dart +++ b/lib/src/model/generator_params_list.dart @@ -7,10 +7,10 @@ class GeneratorParamsList { List? barcodeBuilders = []; /* Shift step according to X axis */ - int? xStep = null; + int? xStep; /* Shift step according to Y axis */ - int? yStep = null; + int? yStep; GeneratorParamsList(); @@ -35,7 +35,7 @@ class GeneratorParamsList { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = GeneratorParamsList.fromJson(value)); diff --git a/lib/src/model/han_xin_encode_mode.dart b/lib/src/model/han_xin_encode_mode.dart index 1c92081..48ff8de 100644 --- a/lib/src/model/han_xin_encode_mode.dart +++ b/lib/src/model/han_xin_encode_mode.dart @@ -55,6 +55,7 @@ class HanXinEncodeMode { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/han_xin_error_level.dart b/lib/src/model/han_xin_error_level.dart index 69340dc..b4ed864 100644 --- a/lib/src/model/han_xin_error_level.dart +++ b/lib/src/model/han_xin_error_level.dart @@ -43,6 +43,7 @@ class HanXinErrorLevel { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/han_xin_params.dart b/lib/src/model/han_xin_params.dart index 7cf494c..b3e45ad 100644 --- a/lib/src/model/han_xin_params.dart +++ b/lib/src/model/han_xin_params.dart @@ -4,16 +4,16 @@ import '../../aspose_barcode_cloud.dart'; class HanXinParams { /* Encoding mode for XanXin barcodes. Default value: HanXinEncodeMode.Auto. */ - HanXinEncodeMode? encodeMode = null; + HanXinEncodeMode? encodeMode; /* Allowed Han Xin error correction levels from L1 to L4. Default value: HanXinErrorLevel.L1. */ - HanXinErrorLevel? errorLevel = null; + HanXinErrorLevel? errorLevel; /* Allowed Han Xin versions, Auto and Version01 - Version84. Default value: HanXinVersion.Auto. */ - HanXinVersion? version = null; + HanXinVersion? version; /* Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details about the used references for encoding the data in the symbol. Current implementation consists all well known charset encodings. Default value: ECIEncodings.ISO_8859_1 */ - ECIEncodings? eCIEncoding = null; + ECIEncodings? eCIEncoding; HanXinParams(); @@ -44,7 +44,7 @@ class HanXinParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = HanXinParams.fromJson(value)); diff --git a/lib/src/model/han_xin_version.dart b/lib/src/model/han_xin_version.dart index b94cfe6..7238247 100644 --- a/lib/src/model/han_xin_version.dart +++ b/lib/src/model/han_xin_version.dart @@ -529,6 +529,7 @@ class HanXinVersion { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/itf14_border_type.dart b/lib/src/model/itf14_border_type.dart index f1d2ad6..a189d47 100644 --- a/lib/src/model/itf14_border_type.dart +++ b/lib/src/model/itf14_border_type.dart @@ -49,6 +49,7 @@ class ITF14BorderType { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/itf_params.dart b/lib/src/model/itf_params.dart index 07cb2ce..b271060 100644 --- a/lib/src/model/itf_params.dart +++ b/lib/src/model/itf_params.dart @@ -4,13 +4,13 @@ import '../../aspose_barcode_cloud.dart'; class ITFParams { /* ITF border (bearer bar) thickness in Unit value. Default value: 12pt. */ - double? borderThickness = null; + double? borderThickness; /* Border type of ITF barcode. Default value: ITF14BorderType.Bar. */ - ITF14BorderType? borderType = null; + ITF14BorderType? borderType; /* Size of the quiet zones in xDimension. Default value: 10, meaning if xDimension = 2px than quiet zones will be 20px. */ - int? quietZoneCoef = null; + int? quietZoneCoef; ITFParams(); @@ -20,9 +20,7 @@ class ITFParams { } ITFParams.fromJson(Map json) { - borderThickness = json['borderThickness'] == null - ? null - : json['borderThickness'].toDouble(); + borderThickness = json['borderThickness']?.toDouble(); borderType = ITF14BorderType.fromJson(json['borderType']); quietZoneCoef = json['quietZoneCoef']; } @@ -41,7 +39,7 @@ class ITFParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = ITFParams.fromJson(value)); diff --git a/lib/src/model/macro_character.dart b/lib/src/model/macro_character.dart index bd473b3..39684e1 100644 --- a/lib/src/model/macro_character.dart +++ b/lib/src/model/macro_character.dart @@ -37,6 +37,7 @@ class MacroCharacter { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/maxi_code_encode_mode.dart b/lib/src/model/maxi_code_encode_mode.dart index 8561684..2be9d8a 100644 --- a/lib/src/model/maxi_code_encode_mode.dart +++ b/lib/src/model/maxi_code_encode_mode.dart @@ -38,6 +38,7 @@ class MaxiCodeEncodeMode { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/maxi_code_mode.dart b/lib/src/model/maxi_code_mode.dart index 754e1d4..db7ad71 100644 --- a/lib/src/model/maxi_code_mode.dart +++ b/lib/src/model/maxi_code_mode.dart @@ -49,6 +49,7 @@ class MaxiCodeMode { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/maxi_code_params.dart b/lib/src/model/maxi_code_params.dart index 129beda..2f82962 100644 --- a/lib/src/model/maxi_code_params.dart +++ b/lib/src/model/maxi_code_params.dart @@ -4,13 +4,13 @@ import '../../aspose_barcode_cloud.dart'; class MaxiCodeParams { /* Height/Width ratio of 2D BarCode module. */ - double? aspectRatio = null; + double? aspectRatio; /* Mode for MaxiCode barcodes. */ - MaxiCodeMode? mode = null; + MaxiCodeMode? mode; /* Encoding mode for MaxiCode barcodes. */ - MaxiCodeEncodeMode? encodeMode = null; + MaxiCodeEncodeMode? encodeMode; MaxiCodeParams(); @@ -20,8 +20,7 @@ class MaxiCodeParams { } MaxiCodeParams.fromJson(Map json) { - aspectRatio = - json['aspectRatio'] == null ? null : json['aspectRatio'].toDouble(); + aspectRatio = json['aspectRatio']?.toDouble(); mode = MaxiCodeMode.fromJson(json['mode']); encodeMode = MaxiCodeEncodeMode.fromJson(json['encodeMode']); } @@ -36,7 +35,7 @@ class MaxiCodeParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = MaxiCodeParams.fromJson(value)); diff --git a/lib/src/model/object_exist.dart b/lib/src/model/object_exist.dart index 30b5b9e..88898b7 100644 --- a/lib/src/model/object_exist.dart +++ b/lib/src/model/object_exist.dart @@ -3,10 +3,10 @@ class ObjectExist { /* Indicates that the file or folder exists. */ - bool? exists = null; + bool? exists; /* True if it is a folder, false if it is a file. */ - bool? isFolder = null; + bool? isFolder; ObjectExist(); @@ -30,7 +30,7 @@ class ObjectExist { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = ObjectExist.fromJson(value)); diff --git a/lib/src/model/padding.dart b/lib/src/model/padding.dart index 3a75ea0..63d0b42 100644 --- a/lib/src/model/padding.dart +++ b/lib/src/model/padding.dart @@ -3,16 +3,16 @@ class Padding { /* Left padding. */ - double? left = null; + double? left; /* Right padding. */ - double? right = null; + double? right; /* Top padding. */ - double? top = null; + double? top; /* Bottom padding. */ - double? bottom = null; + double? bottom; Padding(); @@ -22,10 +22,10 @@ class Padding { } Padding.fromJson(Map json) { - left = json['left'] == null ? null : json['left'].toDouble(); - right = json['right'] == null ? null : json['right'].toDouble(); - top = json['top'] == null ? null : json['top'].toDouble(); - bottom = json['bottom'] == null ? null : json['bottom'].toDouble(); + left = json['left']?.toDouble(); + right = json['right']?.toDouble(); + top = json['top']?.toDouble(); + bottom = json['bottom']?.toDouble(); } Map toJson() { @@ -38,7 +38,7 @@ class Padding { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = Padding.fromJson(value)); diff --git a/lib/src/model/patch_code_params.dart b/lib/src/model/patch_code_params.dart index 24e8e2e..a75484d 100644 --- a/lib/src/model/patch_code_params.dart +++ b/lib/src/model/patch_code_params.dart @@ -4,10 +4,10 @@ import '../../aspose_barcode_cloud.dart'; class PatchCodeParams { /* Specifies codetext for an extra QR barcode, when PatchCode is generated in page mode. */ - String? extraBarcodeText = null; + String? extraBarcodeText; /* PatchCode format. Choose PatchOnly to generate single PatchCode. Use page format to generate Patch page with PatchCodes as borders. Default value: PatchFormat.PatchOnly */ - PatchFormat? patchFormat = null; + PatchFormat? patchFormat; PatchCodeParams(); @@ -31,7 +31,7 @@ class PatchCodeParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = PatchCodeParams.fromJson(value)); diff --git a/lib/src/model/patch_format.dart b/lib/src/model/patch_format.dart index 8417d5d..233db7a 100644 --- a/lib/src/model/patch_format.dart +++ b/lib/src/model/patch_format.dart @@ -50,6 +50,7 @@ class PatchFormat { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/pdf417_compaction_mode.dart b/lib/src/model/pdf417_compaction_mode.dart index ff81ab1..a602a3d 100644 --- a/lib/src/model/pdf417_compaction_mode.dart +++ b/lib/src/model/pdf417_compaction_mode.dart @@ -45,6 +45,7 @@ class Pdf417CompactionMode { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/pdf417_error_level.dart b/lib/src/model/pdf417_error_level.dart index e4f055e..95442ee 100644 --- a/lib/src/model/pdf417_error_level.dart +++ b/lib/src/model/pdf417_error_level.dart @@ -73,6 +73,7 @@ class Pdf417ErrorLevel { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/pdf417_macro_terminator.dart b/lib/src/model/pdf417_macro_terminator.dart index 504fcd3..eedb210 100644 --- a/lib/src/model/pdf417_macro_terminator.dart +++ b/lib/src/model/pdf417_macro_terminator.dart @@ -37,6 +37,7 @@ class Pdf417MacroTerminator { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/pdf417_params.dart b/lib/src/model/pdf417_params.dart index 5e3d606..4a32ecb 100644 --- a/lib/src/model/pdf417_params.dart +++ b/lib/src/model/pdf417_params.dart @@ -4,80 +4,80 @@ import '../../aspose_barcode_cloud.dart'; class Pdf417Params { /* Height/Width ratio of 2D BarCode module. */ - double? aspectRatio = null; + double? aspectRatio; /* DEPRECATED: This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. */ @Deprecated( "This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. ") - String? textEncoding = null; + String? textEncoding; /* Columns count. */ - int? columns = null; + int? columns; /* Pdf417 symbology type of BarCode's compaction mode. Default value: Pdf417CompactionMode.Auto. */ - Pdf417CompactionMode? compactionMode = null; + Pdf417CompactionMode? compactionMode; /* Pdf417 symbology type of BarCode's error correction level ranging from level0 to level8, level0 means no error correction info, level8 means best error correction which means a larger picture. */ - Pdf417ErrorLevel? errorLevel = null; + Pdf417ErrorLevel? errorLevel; /* Macro Pdf417 barcode's file ID. Used for MacroPdf417. */ - int? macroFileID = null; + int? macroFileID; /* Macro Pdf417 barcode's segment ID, which starts from 0, to MacroSegmentsCount - 1. */ - int? macroSegmentID = null; + int? macroSegmentID; /* Macro Pdf417 barcode segments count. */ - int? macroSegmentsCount = null; + int? macroSegmentsCount; /* Rows count. */ - int? rows = null; + int? rows; /* Whether Pdf417 symbology type of BarCode is truncated (to reduce space). */ - bool? truncate = null; + bool? truncate; /* Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details about the used references for encoding the data in the symbol. Current implementation consists all well known charset encodings. */ - ECIEncodings? pdf417ECIEncoding = null; + ECIEncodings? pdf417ECIEncoding; /* Used to instruct the reader to interpret the data contained within the symbol as programming for reader initialization */ - bool? isReaderInitialization = null; + bool? isReaderInitialization; /* Macro Pdf417 barcode time stamp */ - DateTime? macroTimeStamp = null; + DateTime? macroTimeStamp; /* Macro Pdf417 barcode sender name */ - String? macroSender = null; + String? macroSender; /* Macro Pdf417 file size. The file size field contains the size in bytes of the entire source file */ - int? macroFileSize = null; + int? macroFileSize; /* Macro Pdf417 barcode checksum. The checksum field contains the value of the 16-bit (2 bytes) CRC checksum using the CCITT-16 polynomial */ - int? macroChecksum = null; + int? macroChecksum; /* Macro Pdf417 barcode file name */ - String? macroFileName = null; + String? macroFileName; /* Macro Pdf417 barcode addressee name */ - String? macroAddressee = null; + String? macroAddressee; /* Extended Channel Interpretation Identifiers. Applies for Macro PDF417 text fields. */ - ECIEncodings? macroECIEncoding = null; + ECIEncodings? macroECIEncoding; /* DEPRECATED: This property is obsolete and will be removed in future releases. See samples of using new parameters on https://releases.aspose.com/barcode/net/release-notes/2023/aspose-barcode-for-net-23-10-release-notes/ Function codeword for Code 128 emulation. Applied for MicroPDF417 only. Ignored for PDF417 and MacroPDF417 barcodes. */ @Deprecated( "This property is obsolete and will be removed in future releases. See samples of using new parameters on https://releases.aspose.com/barcode/net/release-notes/2023/aspose-barcode-for-net-23-10-release-notes/ Function codeword for Code 128 emulation. Applied for MicroPDF417 only. Ignored for PDF417 and MacroPDF417 barcodes. ") - Code128Emulation? code128Emulation = null; + Code128Emulation? code128Emulation; /* Can be used only with MicroPdf417 and encodes Code 128 emulation modes. Can encode FNC1 in second position modes 908 and 909, also can encode 910 and 911 which just indicate that recognized MicroPdf417 can be interpret as Code 128. */ - bool? isCode128Emulation = null; + bool? isCode128Emulation; /* Used to tell the encoder whether to add Macro PDF417 Terminator (codeword 922) to the segment. Applied only for Macro PDF417. */ - Pdf417MacroTerminator? pdf417MacroTerminator = null; + Pdf417MacroTerminator? pdf417MacroTerminator; /* Defines linked modes with GS1MicroPdf417, MicroPdf417 and Pdf417 barcodes. With GS1MicroPdf417 symbology encodes 906, 907, 912, 913, 914, 915 “Linked” UCC/EAN-128 modes. With MicroPdf417 and Pdf417 symbologies encodes 918 linkage flag to associated linear component other than an EAN.UCC. */ - bool? isLinked = null; + bool? isLinked; /* Macro Characters 05 and 06 values are used to obtain more compact encoding in special modes. Can be used only with MicroPdf417 and encodes 916 and 917 MicroPdf417 modes. Default value: MacroCharacters.None. */ - MacroCharacter? macroCharacters = null; + MacroCharacter? macroCharacters; Pdf417Params(); @@ -87,8 +87,7 @@ class Pdf417Params { } Pdf417Params.fromJson(Map json) { - aspectRatio = - json['aspectRatio'] == null ? null : json['aspectRatio'].toDouble(); + aspectRatio = json['aspectRatio']?.toDouble(); textEncoding = json['textEncoding']; columns = json['columns']; compactionMode = Pdf417CompactionMode.fromJson(json['compactionMode']); @@ -154,7 +153,7 @@ class Pdf417Params { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = Pdf417Params.fromJson(value)); diff --git a/lib/src/model/postal_params.dart b/lib/src/model/postal_params.dart index 38a94a4..947c3ef 100644 --- a/lib/src/model/postal_params.dart +++ b/lib/src/model/postal_params.dart @@ -3,7 +3,7 @@ class PostalParams { /* Short bar's height of Postal barcodes. */ - double? shortBarHeight = null; + double? shortBarHeight; PostalParams(); @@ -13,9 +13,7 @@ class PostalParams { } PostalParams.fromJson(Map json) { - shortBarHeight = json['shortBarHeight'] == null - ? null - : json['shortBarHeight'].toDouble(); + shortBarHeight = json['shortBarHeight']?.toDouble(); } Map toJson() { @@ -28,7 +26,7 @@ class PostalParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = PostalParams.fromJson(value)); diff --git a/lib/src/model/preset_type.dart b/lib/src/model/preset_type.dart index 30b158c..b544adf 100644 --- a/lib/src/model/preset_type.dart +++ b/lib/src/model/preset_type.dart @@ -57,6 +57,7 @@ class PresetType { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/qr_encode_mode.dart b/lib/src/model/qr_encode_mode.dart index 9211c15..f422781 100644 --- a/lib/src/model/qr_encode_mode.dart +++ b/lib/src/model/qr_encode_mode.dart @@ -56,6 +56,7 @@ class QREncodeMode { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/qr_encode_type.dart b/lib/src/model/qr_encode_type.dart index 9606670..58509cb 100644 --- a/lib/src/model/qr_encode_type.dart +++ b/lib/src/model/qr_encode_type.dart @@ -37,6 +37,7 @@ class QREncodeType { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/qr_error_level.dart b/lib/src/model/qr_error_level.dart index 67ec36f..322bf27 100644 --- a/lib/src/model/qr_error_level.dart +++ b/lib/src/model/qr_error_level.dart @@ -43,6 +43,7 @@ class QRErrorLevel { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/qr_params.dart b/lib/src/model/qr_params.dart index 768f0b1..3cc2409 100644 --- a/lib/src/model/qr_params.dart +++ b/lib/src/model/qr_params.dart @@ -4,30 +4,30 @@ import '../../aspose_barcode_cloud.dart'; class QrParams { /* Height/Width ratio of 2D BarCode module. */ - double? aspectRatio = null; + double? aspectRatio; /* DEPRECATED: This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. */ @Deprecated( "This property is obsolete and will be removed in future releases. Unicode symbols detection and encoding will be processed in Auto mode with Extended Channel Interpretation charset designator. Using of own encodings requires manual CodeText encoding into byte[] array. Sets the encoding of codetext. ") - String? textEncoding = null; + String? textEncoding; /* QR / MicroQR selector mode. Select ForceQR for standard QR symbols, Auto for MicroQR. */ - QREncodeType? encodeType = null; + QREncodeType? encodeType; /* Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details about the used references for encoding the data in the symbol. Current implementation consists all well known charset encodings. */ - ECIEncodings? eCIEncoding = null; + ECIEncodings? eCIEncoding; /* QR symbology type of BarCode's encoding mode. Default value: QREncodeMode.Auto. */ - QREncodeMode? encodeMode = null; + QREncodeMode? encodeMode; /* Level of Reed-Solomon error correction for QR barcode. From low to high: LevelL, LevelM, LevelQ, LevelH. see QRErrorLevel. */ - QRErrorLevel? errorLevel = null; + QRErrorLevel? errorLevel; /* Version of QR Code. From Version1 to Version40 for QR code and from M1 to M4 for MicroQr. Default value is QRVersion.Auto. */ - QRVersion? version = null; + QRVersion? version; /* QR structured append parameters. */ - StructuredAppend? structuredAppend = null; + StructuredAppend? structuredAppend; QrParams(); @@ -37,8 +37,7 @@ class QrParams { } QrParams.fromJson(Map json) { - aspectRatio = - json['aspectRatio'] == null ? null : json['aspectRatio'].toDouble(); + aspectRatio = json['aspectRatio']?.toDouble(); textEncoding = json['textEncoding']; encodeType = QREncodeType.fromJson(json['encodeType']); eCIEncoding = ECIEncodings.fromJson(json['eCIEncoding']); @@ -67,7 +66,7 @@ class QrParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = QrParams.fromJson(value)); diff --git a/lib/src/model/qr_version.dart b/lib/src/model/qr_version.dart index eb23cfb..87d53de 100644 --- a/lib/src/model/qr_version.dart +++ b/lib/src/model/qr_version.dart @@ -289,6 +289,7 @@ class QRVersion { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } diff --git a/lib/src/model/reader_params.dart b/lib/src/model/reader_params.dart index 4b2d161..0a9b4ff 100644 --- a/lib/src/model/reader_params.dart +++ b/lib/src/model/reader_params.dart @@ -4,112 +4,112 @@ import '../../aspose_barcode_cloud.dart'; class ReaderParams { /* The type of barcode to read. */ - DecodeBarcodeType? type = null; + DecodeBarcodeType? type; /* Multiple barcode types to read. */ List? types = []; /* Enable checksum validation during recognition for 1D barcodes. Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible. Checksum never used: Codabar Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN Checksum always used: Rest symbologies */ - ChecksumValidation? checksumValidation = null; + ChecksumValidation? checksumValidation; /* A flag which force engine to detect codetext encoding for Unicode. */ - bool? detectEncoding = null; + bool? detectEncoding; /* Preset allows to configure recognition quality and speed manually. You can quickly set up Preset by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of Preset is NormalQuality. */ - PresetType? preset = null; + PresetType? preset; /* Set X of top left corner of area for recognition. */ - int? rectX = null; + int? rectX; /* Set Y of top left corner of area for recognition. */ - int? rectY = null; + int? rectY; /* Set Width of area for recognition. */ - int? rectWidth = null; + int? rectWidth; /* Set Height of area for recognition. */ - int? rectHeight = null; + int? rectHeight; /* Value indicating whether FNC symbol strip must be done. */ - bool? stripFNC = null; + bool? stripFNC; /* Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. */ - int? timeout = null; + int? timeout; /* Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. */ - int? medianSmoothingWindowSize = null; + int? medianSmoothingWindowSize; /* Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. */ - bool? allowMedianSmoothing = null; + bool? allowMedianSmoothing; /* Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. */ - bool? allowComplexBackground = null; + bool? allowComplexBackground; /* Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots. */ - bool? allowDatamatrixIndustrialBarcodes = null; + bool? allowDatamatrixIndustrialBarcodes; /* Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution. */ - bool? allowDecreasedImage = null; + bool? allowDecreasedImage; /* Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes. */ - bool? allowDetectScanGap = null; + bool? allowDetectScanGap; /* Allows engine to recognize barcodes which has incorrect checksum or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text. */ - bool? allowIncorrectBarcodes = null; + bool? allowIncorrectBarcodes; /* Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background. */ - bool? allowInvertImage = null; + bool? allowInvertImage; /* Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize slightly damaged Postal barcodes. */ - bool? allowMicroWhiteSpotsRemoving = null; + bool? allowMicroWhiteSpotsRemoving; /* Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet. */ - bool? allowOneDFastBarcodesDetector = null; + bool? allowOneDFastBarcodesDetector; /* Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern. */ - bool? allowOneDWipedBarsRestoration = null; + bool? allowOneDWipedBarsRestoration; /* Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes. */ - bool? allowQRMicroQrRestoration = null; + bool? allowQRMicroQrRestoration; /* Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is. */ - bool? allowRegularImage = null; + bool? allowRegularImage; /* Allows engine to recognize barcodes with salt and pepper noise type. Mode can remove small noise with white and black dots. */ - bool? allowSaltAndPepperFiltering = null; + bool? allowSaltAndPepperFiltering; /* Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering. */ - bool? allowWhiteSpotsRemoving = null; + bool? allowWhiteSpotsRemoving; /* Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. Default value: False. */ - bool? checkMore1DVariants = null; + bool? checkMore1DVariants; /* Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms. Default value: False. */ - bool? fastScanOnly = null; + bool? fastScanOnly; /* Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. */ - bool? allowAdditionalRestorations = null; + bool? allowAdditionalRestorations; /* Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. */ - double? regionLikelihoodThresholdPercent = null; + double? regionLikelihoodThresholdPercent; /* Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. */ List? scanWindowSizes = []; /* Similarity coefficient depends on how homogeneous barcodes are. Use high value for for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] */ - double? similarity = null; + double? similarity; /* Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. */ - bool? skipDiagonalSearch = null; + bool? skipDiagonalSearch; /* Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. */ - bool? readTinyBarcodes = null; + bool? readTinyBarcodes; /* Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. */ - CustomerInformationInterpretingType? australianPostEncodingTable = null; + CustomerInformationInterpretingType? australianPostEncodingTable; /* The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". */ - bool? ignoreEndingFillingPatternsForCTable = null; + bool? ignoreEndingFillingPatternsForCTable; ReaderParams(); @@ -151,13 +151,10 @@ class ReaderParams { fastScanOnly = json['fastScanOnly']; allowAdditionalRestorations = json['allowAdditionalRestorations']; regionLikelihoodThresholdPercent = - json['regionLikelihoodThresholdPercent'] == null - ? null - : json['regionLikelihoodThresholdPercent'].toDouble(); + json['regionLikelihoodThresholdPercent']?.toDouble(); scanWindowSizes = (json['scanWindowSizes'] as List).map((item) => item as int).toList(); - similarity = - json['similarity'] == null ? null : json['similarity'].toDouble(); + similarity = json['similarity']?.toDouble(); skipDiagonalSearch = json['skipDiagonalSearch']; readTinyBarcodes = json['readTinyBarcodes']; australianPostEncodingTable = CustomerInformationInterpretingType.fromJson( @@ -214,7 +211,7 @@ class ReaderParams { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = ReaderParams.fromJson(value)); diff --git a/lib/src/model/region_point.dart b/lib/src/model/region_point.dart index bc4f6e7..c3d900d 100644 --- a/lib/src/model/region_point.dart +++ b/lib/src/model/region_point.dart @@ -3,10 +3,10 @@ class RegionPoint { /* X-coordinate */ - int? X = null; + int? X; /* Y-coordinate */ - int? Y = null; + int? Y; RegionPoint(); @@ -30,7 +30,7 @@ class RegionPoint { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = RegionPoint.fromJson(value)); diff --git a/lib/src/model/result_image_info.dart b/lib/src/model/result_image_info.dart index 06e79c6..0390ae6 100644 --- a/lib/src/model/result_image_info.dart +++ b/lib/src/model/result_image_info.dart @@ -3,13 +3,13 @@ class ResultImageInfo { /* Result file size. */ - int? fileSize = null; + int? fileSize; /* Result image width. */ - int? imageWidth = null; + int? imageWidth; /* Result image height. */ - int? imageHeight = null; + int? imageHeight; ResultImageInfo(); @@ -38,7 +38,7 @@ class ResultImageInfo { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = ResultImageInfo.fromJson(value)); diff --git a/lib/src/model/storage_exist.dart b/lib/src/model/storage_exist.dart index cc6eab2..399ff8e 100644 --- a/lib/src/model/storage_exist.dart +++ b/lib/src/model/storage_exist.dart @@ -3,7 +3,7 @@ class StorageExist { /* Shows that the storage exists. */ - bool? exists = null; + bool? exists; StorageExist(); @@ -26,7 +26,7 @@ class StorageExist { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = StorageExist.fromJson(value)); diff --git a/lib/src/model/storage_file.dart b/lib/src/model/storage_file.dart index 2890e87..00bc435 100644 --- a/lib/src/model/storage_file.dart +++ b/lib/src/model/storage_file.dart @@ -3,19 +3,19 @@ class StorageFile { /* File or folder name. */ - String? name = null; + String? name; /* True if it is a folder. */ - bool? isFolder = null; + bool? isFolder; /* File or folder last modified DateTime. */ - DateTime? modifiedDate = null; + DateTime? modifiedDate; /* File or folder size. */ - int? size = null; + int? size; /* File or folder path. */ - String? path = null; + String? path; StorageFile(); @@ -51,7 +51,7 @@ class StorageFile { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = StorageFile.fromJson(value)); diff --git a/lib/src/model/structured_append.dart b/lib/src/model/structured_append.dart index e816671..085a8eb 100644 --- a/lib/src/model/structured_append.dart +++ b/lib/src/model/structured_append.dart @@ -3,13 +3,13 @@ class StructuredAppend { /* The index of the QR structured append mode barcode. Index starts from 0. */ - int? sequenceIndicator = null; + int? sequenceIndicator; /* QR structured append mode barcodes quantity. Max value is 16. */ - int? totalCount = null; + int? totalCount; /* QR structured append mode parity data. */ - int? parityByte = null; + int? parityByte; StructuredAppend(); @@ -38,7 +38,7 @@ class StructuredAppend { static Map mapFromJson( Map> json) { - final map = Map(); + final map = {}; if (json.isNotEmpty) { json.forEach((String key, Map value) => map[key] = StructuredAppend.fromJson(value)); diff --git a/lib/src/model/text_alignment.dart b/lib/src/model/text_alignment.dart index a3ac13d..aa36f2a 100644 --- a/lib/src/model/text_alignment.dart +++ b/lib/src/model/text_alignment.dart @@ -37,6 +37,7 @@ class TextAlignment { return value; } + @override String toString() { return value == null ? "null" : value.toString(); } From 155cb3098f4c4e9a21581eb7786c2401763bc5b0 Mon Sep 17 00:00:00 2001 From: Denis Averin Date: Wed, 28 Feb 2024 20:10:49 +0700 Subject: [PATCH 5/6] Add CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed31218..83e8c95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 1.24.2 +* Improve code quality +* Use lints/recommended.yaml instead of lints/core.yaml + ## 1.24.1 * "types" param for multiple barcode types to read added. From fb585602260cd027d427fd1b3381d49160a4b89a Mon Sep 17 00:00:00 2001 From: Denis Averin Date: Thu, 29 Feb 2024 02:20:34 +0700 Subject: [PATCH 6/6] Add 'types' field to recognition tests --- ..._generate_file_put_barcode_recognize_from_body_test.dart | 6 +++++- test/put_generate_multiple_get_barcode_recognize_test.dart | 1 + test/recognize_test.dart | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/put_barcode_generate_file_put_barcode_recognize_from_body_test.dart b/test/put_barcode_generate_file_put_barcode_recognize_from_body_test.dart index 9cec0fc..85273e6 100644 --- a/test/put_barcode_generate_file_put_barcode_recognize_from_body_test.dart +++ b/test/put_barcode_generate_file_put_barcode_recognize_from_body_test.dart @@ -19,10 +19,14 @@ void main() { }); test('.putBarcodeRecognizeFromBody', () async { + final params = ReaderParams(); + params.preset = PresetType.highPerformance_; + params.types = [DecodeBarcodeType.qR_, DecodeBarcodeType.dataMatrix_]; + final BarcodeResponseList recognized = await TestConfig.barcodeApi.putBarcodeRecognizeFromBody( remoteFileName, - ReaderParams()..preset = PresetType.highPerformance_, + params, folder: TestConfig.folder, ); diff --git a/test/put_generate_multiple_get_barcode_recognize_test.dart b/test/put_generate_multiple_get_barcode_recognize_test.dart index 4c162c2..f7924b3 100644 --- a/test/put_generate_multiple_get_barcode_recognize_test.dart +++ b/test/put_generate_multiple_get_barcode_recognize_test.dart @@ -30,6 +30,7 @@ void main() { remoteFileName, folder: TestConfig.folder, preset: PresetType.highPerformance_.value, + types: [DecodeBarcodeType.qR_, DecodeBarcodeType.dataMatrix_], ); expect(recognized.barcodes, isNotNull); diff --git a/test/recognize_test.dart b/test/recognize_test.dart index 931462f..24cb5b8 100644 --- a/test/recognize_test.dart +++ b/test/recognize_test.dart @@ -13,6 +13,7 @@ void main() { await TestConfig.barcodeApi.postBarcodeRecognizeFromUrlOrContent( image: barcode, preset: PresetType.highPerformance_.toString(), + types: [DecodeBarcodeType.qR_, DecodeBarcodeType.dataMatrix_], ); expect(recognized, isNotNull); @@ -27,7 +28,6 @@ void main() { () async => { await TestConfig.barcodeApi.postBarcodeRecognizeFromUrlOrContent( image: barcode, - preset: PresetType.highPerformance_.toString(), timeout: 1, ) },