Skip to content

Release 24.9 #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## 1.24.9

* Update documentation

* Add checksumValidation to Scan

* Add tests for Code39 type without checksum

## 1.24.8

* August 2024 Release
Expand Down
Binary file added Code39.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.8
- SDK version: 1.24.9

This SDK allows you to work with Aspose.BarCode for Cloud REST APIs in your Dart or Flutter applications quickly and easily

Expand Down Expand Up @@ -34,7 +34,7 @@ Add this dependency to your *pubspec.yaml*:

```yaml
dependencies:
aspose_barcode_cloud: 1.24.8
aspose_barcode_cloud: 1.24.9
```

## Sample usage
Expand Down
50 changes: 24 additions & 26 deletions doc/api/BarcodeApi.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/models/CaptionParams.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Name | Type | Description | Notes
---- | ---- | ----------- | -----
**text** | **String** | Caption text. | [optional] [default to null]
**alignment** | [**TextAlignment**](TextAlignment.md) | Text alignment. | [optional] [default to null]
**color** | **String** | Text color. | [optional] [default to null]
**color** | **String** | Text color. Default value: black Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] [default to null]
**visible** | **bool** | Is caption visible. | [optional] [default to null]
**font** | [**FontParams**](FontParams.md) | Font. | [optional] [default to null]
**padding** | [**Padding**](Padding.md) | Padding. | [optional] [default to null]
Expand Down
10 changes: 5 additions & 5 deletions doc/models/GeneratorParams.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Name | Type | Description | Notes
**twoDDisplayText** | **String** | Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode | [optional] [default to null]
**textLocation** | [**CodeLocation**](CodeLocation.md) | Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. | [optional] [default to null]
**textAlignment** | [**TextAlignment**](TextAlignment.md) | Text alignment. | [optional] [default to null]
**textColor** | **String** | Specify the displaying CodeText's Color. Default value: Color.Black. | [optional] [default to null]
**textColor** | **String** | Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] [default to null]
**font** | [**FontParams**](FontParams.md) | Specify the displaying Text's font. Default value: Arial 5pt regular. Ignored if FontSizeMode is set to FontSizeMode.Auto. | [optional] [default to null]
**fontSizeMode** | [**FontMode**](FontMode.md) | 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. | [optional] [default to null]
**noWrap** | **bool** | Specify word wraps (line breaks) within text. Default value: false. | [optional] [default to null]
Expand All @@ -34,9 +34,9 @@ Name | Type | Description | Notes
**padding** | [**Padding**](Padding.md) | Barcode paddings. Default value: 5pt 5pt 5pt 5pt. | [optional] [default to null]
**captionAbove** | [**CaptionParams**](CaptionParams.md) | Additional caption above barcode. | [optional] [default to null]
**captionBelow** | [**CaptionParams**](CaptionParams.md) | Additional caption below barcode. | [optional] [default to null]
**backColor** | **String** | Background color of the barcode image. Default value: Color.White. | [optional] [default to null]
**barColor** | **String** | Bars color. Default value: Color.Black. | [optional] [default to null]
**borderColor** | **String** | Border color. Default value: Color.Black. | [optional] [default to null]
**backColor** | **String** | Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] [default to null]
**barColor** | **String** | Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] [default to null]
**borderColor** | **String** | Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF | [optional] [default to null]
**borderWidth** | **double** | Border width. Default value: 0. Ignored if Visible is set to false. | [optional] [default to null]
**borderDashStyle** | [**BorderDashStyle**](BorderDashStyle.md) | Border dash style. Default value: BorderDashStyle.Solid. | [optional] [default to null]
**borderVisible** | **bool** | Border visibility. If false than parameter Width is always ignored (0). Default value: false. | [optional] [default to null]
Expand Down Expand Up @@ -65,6 +65,6 @@ Name | Type | Description | Notes
**postal** | [**PostalParams**](PostalParams.md) | Postal params. | [optional] [default to null]
**QR** | [**QrParams**](QrParams.md) | QR params. | [optional] [default to null]
**patchCode** | [**PatchCodeParams**](PatchCodeParams.md) | PatchCode params. | [optional] [default to null]
**code128** | [**Code128Params**](Code128Params.md) | Code128 params. | [optional] [default to null]
**code128** | [**Code128Params**](Code128Params.md) | Code128 parameters | [optional] [default to null]
**hanXin** | [**HanXinParams**](HanXinParams.md) | HanXin params. | [optional] [default to null]

25 changes: 14 additions & 11 deletions lib/src/api/barcode_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class BarcodeApi {
String? textLocation,
String? textAlignment,
String? textColor,
String? fontSizeMode,
bool? noWrap,
double? resolution,
double? resolutionX,
Expand Down Expand Up @@ -80,10 +79,6 @@ class BarcodeApi {
queryParams.addAll(
convertParametersForCollectionFormat("", "TextColor", textColor));
}
if (fontSizeMode != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "FontSizeMode", fontSizeMode));
}
if (noWrap != null) {
queryParams
.addAll(convertParametersForCollectionFormat("", "NoWrap", noWrap));
Expand Down Expand Up @@ -751,7 +746,6 @@ class BarcodeApi {
String? textLocation,
String? textAlignment,
String? textColor,
String? fontSizeMode,
bool? noWrap,
double? resolution,
double? resolutionX,
Expand Down Expand Up @@ -813,10 +807,6 @@ class BarcodeApi {
queryParams.addAll(
convertParametersForCollectionFormat("", "TextColor", textColor));
}
if (fontSizeMode != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "FontSizeMode", fontSizeMode));
}
if (noWrap != null) {
queryParams
.addAll(convertParametersForCollectionFormat("", "NoWrap", noWrap));
Expand Down Expand Up @@ -1064,7 +1054,9 @@ class BarcodeApi {
/// Quickly scan a barcode from an image.
///
Future<BarcodeResponseList> scanBarcode(MultipartFile imageFile,
{List<DecodeBarcodeType>? decodeTypes, int? timeout}) async {
{List<DecodeBarcodeType>? decodeTypes,
int? timeout,
String? checksumValidation}) async {
// ignore: prefer_final_locals
Object? postBody;

Expand Down Expand Up @@ -1102,6 +1094,13 @@ class BarcodeApi {
mp.fields['timeout'] = [parameterToString(timeout)];
}

if (checksumValidation != null) {
hasFields = true;
mp.fields['checksumValidation'] = [
parameterToString(checksumValidation)
];
}

if (hasFields) {
postBody = mp;
}
Expand All @@ -1112,6 +1111,10 @@ class BarcodeApi {
if (timeout != null) {
formParams['timeout'] = parameterToString(timeout);
}
if (checksumValidation != null) {
formParams['checksumValidation'] =
parameterToString(checksumValidation);
}
}

final response = await _apiClient.invokeAPI(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/api_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'api_helper.dart';
import 'auth/authentication.dart';

/// Current SDK Version
const SDK_VERSION = "1.24.8";
const SDK_VERSION = "1.24.9";

/// ApiClient is responsible for making HTTP requests to the API.
class ApiClient {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/model/caption_params.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CaptionParams {
/// Text alignment.
TextAlignment? alignment;

/// Text color.
/// Text color. Default value: black Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF
String? color;

/// Is caption visible.
Expand Down
10 changes: 5 additions & 5 deletions lib/src/model/generator_params.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class GeneratorParams {
/// Text alignment.
TextAlignment? textAlignment;

/// Specify the displaying CodeText's Color. Default value: Color.Black.
/// Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF
String? textColor;

/// Specify the displaying Text's font. Default value: Arial 5pt regular. Ignored if FontSizeMode is set to FontSizeMode.Auto.
Expand Down Expand Up @@ -73,13 +73,13 @@ class GeneratorParams {
/// Additional caption below barcode.
CaptionParams? captionBelow;

/// Background color of the barcode image. Default value: Color.White.
/// Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF
String? backColor;

/// Bars color. Default value: Color.Black.
/// Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF
String? barColor;

/// Border color. Default value: Color.Black.
/// Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF
String? borderColor;

/// Border width. Default value: 0. Ignored if Visible is set to false.
Expand Down Expand Up @@ -166,7 +166,7 @@ class GeneratorParams {
/// PatchCode params.
PatchCodeParams? patchCode;

/// Code128 params.
/// Code128 parameters
Code128Params? code128;

/// HanXin params.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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.8
version: 1.24.9
homepage: https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dart

platforms:
Expand Down
20 changes: 20 additions & 0 deletions test/scan_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,24 @@ void main() {
expect(recognized.barcodes![1].barcodeValue, equals('Code128 text'));
},
);

test(
'.scanBarcodes can scan Code39',
() async {
final barcode = await MultipartFile.fromPath("ImageFile", "Code39.jpg");
final BarcodeResponseList recognized =
await TestConfig.barcodeApi.scanBarcode(
barcode,
decodeTypes: [DecodeBarcodeType.Code39Extended],
checksumValidation: ChecksumValidation.Off.toString(),
);

expect(recognized, isNotNull);
expect(recognized.barcodes, isNotEmpty);
expect(recognized.barcodes!.length, equals(1));

expect(recognized.barcodes![0].type, equals('Code39Extended'));
expect(recognized.barcodes![0].barcodeValue, equals('8M93'));
},
);
}