diff --git a/packages/syncfusion_flutter_barcodes/CHANGELOG.md b/packages/syncfusion_flutter_barcodes/CHANGELOG.md
index 2181d1b23..2533f0f63 100644
--- a/packages/syncfusion_flutter_barcodes/CHANGELOG.md
+++ b/packages/syncfusion_flutter_barcodes/CHANGELOG.md
@@ -2,6 +2,18 @@
**General**
+* The compatible version of our Flutter barcodes widget has been updated to Flutter SDK 3.32.0.
+
+## [29.1.39] - 22/04/2025
+
+**General**
+
+* The minimum Dart version has been updated to 3.7.
+
+## [29.1.33] - 25/03/2025
+
+**General**
+
* The compatible version of our Flutter barcodes widget has been updated to Flutter SDK 3.29.0.
* The Syncfusion® Flutter barcodes example sample have been updated to support [kotlin build scripts](https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply) in Android platform.
* The Syncfusion® Flutter barcodes example sample have been updated to support [Swift package manager](https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-app-developers) in macOS and iOS platforms.
diff --git a/packages/syncfusion_flutter_barcodes/example/lib/main.dart b/packages/syncfusion_flutter_barcodes/example/lib/main.dart
index 8d333b1eb..ddec1a8fe 100644
--- a/packages/syncfusion_flutter_barcodes/example/lib/main.dart
+++ b/packages/syncfusion_flutter_barcodes/example/lib/main.dart
@@ -11,18 +11,18 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
- appBar: AppBar(
- title: const Text('Barcode Generator Demo'),
- ),
- body: Center(
- child: Container(
+ appBar: AppBar(title: const Text('Barcode Generator Demo')),
+ body: Center(
+ child: Container(
height: 200,
child: SfBarcodeGenerator(
value: 'www.syncfusion.com',
symbology: QRCode(),
showValue: true,
),
- ))),
+ ),
+ ),
+ ),
);
}
}
diff --git a/packages/syncfusion_flutter_barcodes/example/pubspec.yaml b/packages/syncfusion_flutter_barcodes/example/pubspec.yaml
index 76d0b94a8..deef8cd6a 100644
--- a/packages/syncfusion_flutter_barcodes/example/pubspec.yaml
+++ b/packages/syncfusion_flutter_barcodes/example/pubspec.yaml
@@ -1,20 +1,10 @@
name: example
description: A new Flutter project.
-# The following defines the version and build number for your application.
-# A version number is three numbers separated by dots, like 1.2.43
-# followed by an optional build number separated by a +.
-# Both the version and the builder number may be overridden in flutter
-# build by specifying --build-name and --build-number, respectively.
-# In Android, build-name is used as versionName while build-number used as versionCode.
-# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
-# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
-# Read more about iOS versioning at
-# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0
environment:
- sdk: '>=3.3.0 <4.0.0'
+ sdk: ^3.7.0-0
dependencies:
flutter:
@@ -22,53 +12,12 @@ dependencies:
syncfusion_flutter_barcodes:
path: ../
- # The following adds the Cupertino Icons font to your application.
- # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
-
-# For information on the generic Dart part of this file, see the
-# following page: https://dart.dev/tools/pub/pubspec
-
-# The following section is specific to Flutter.
flutter:
- # The following line ensures that the Material Icons font is
- # included with your application, so that you can use the icons in
- # the material Icons class.
uses-material-design: true
-
- # To add assets to your application, add an assets section, like this:
- # assets:
- # - images/a_dot_burr.jpeg
- # - images/a_dot_ham.jpeg
-
- # An image asset can refer to one or more resolution-specific "variants", see
- # https://flutter.dev/assets-and-images/#resolution-aware.
-
- # For details regarding adding assets from package dependencies, see
- # https://flutter.dev/assets-and-images/#from-packages
-
- # To add custom fonts to your application, add a fonts section here,
- # in this "flutter" section. Each entry in this list should have a
- # "family" key with the font family name, and a "fonts" key with a
- # list giving the asset and other descriptors for the font. For
- # example:
- # fonts:
- # - family: Schyler
- # fonts:
- # - asset: fonts/Schyler-Regular.ttf
- # - asset: fonts/Schyler-Italic.ttf
- # style: italic
- # - family: Trajan Pro
- # fonts:
- # - asset: fonts/TrajanPro.ttf
- # - asset: fonts/TrajanPro_Bold.ttf
- # weight: 700
- #
- # For details regarding fonts from package dependencies,
- # see https://flutter.dev/custom-fonts/#from-packages
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/base/barcode_generator.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/base/barcode_generator.dart
index 6f45d19d3..9c1d85f4e 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/base/barcode_generator.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/base/barcode_generator.dart
@@ -84,18 +84,18 @@ class SfBarcodeGenerator extends StatefulWidget {
/// must not be null or empty.
///
/// Default symbology is [Code128].
- SfBarcodeGenerator(
- {Key? key,
- required this.value,
- Symbology? symbology,
- this.barColor,
- this.backgroundColor,
- this.showValue = false,
- this.textSpacing = 2,
- this.textAlign = TextAlign.center,
- this.textStyle})
- : symbology = symbology ?? Code128(),
- super(key: key);
+ SfBarcodeGenerator({
+ Key? key,
+ required this.value,
+ Symbology? symbology,
+ this.barColor,
+ this.backgroundColor,
+ this.showValue = false,
+ this.textSpacing = 2,
+ this.textAlign = TextAlign.center,
+ this.textStyle,
+ }) : symbology = symbology ?? Code128(),
+ super(key: key);
/// Defines the value of the barcode to be rendered.
///
@@ -268,40 +268,51 @@ class _SfBarcodeGeneratorState extends State {
@override
void didChangeDependencies() {
- _barcodeThemeData =
- _updateThemeData(Theme.of(context), SfBarcodeTheme.of(context));
+ _barcodeThemeData = _updateThemeData(
+ Theme.of(context),
+ SfBarcodeTheme.of(context),
+ );
super.didChangeDependencies();
}
SfBarcodeThemeData _updateThemeData(
- ThemeData themeData, SfBarcodeThemeData barcodeThemeData) {
+ ThemeData themeData,
+ SfBarcodeThemeData barcodeThemeData,
+ ) {
final SfBarcodeThemeData effectiveThemeData = BarcodeThemeData(context);
barcodeThemeData = barcodeThemeData.copyWith(
- backgroundColor: barcodeThemeData.backgroundColor ??
- widget.backgroundColor ??
- effectiveThemeData.backgroundColor,
- barColor: barcodeThemeData.barColor ??
- widget.barColor ??
- effectiveThemeData.barColor,
- textStyle: themeData.textTheme.bodyMedium!
- .copyWith(
- color:
- barcodeThemeData.textColor ?? effectiveThemeData.textColor)
- .merge(barcodeThemeData.textStyle)
- .merge(widget.textStyle));
+ backgroundColor:
+ barcodeThemeData.backgroundColor ??
+ widget.backgroundColor ??
+ effectiveThemeData.backgroundColor,
+ barColor:
+ barcodeThemeData.barColor ??
+ widget.barColor ??
+ effectiveThemeData.barColor,
+ textStyle: themeData.textTheme.bodyMedium!
+ .copyWith(
+ color: barcodeThemeData.textColor ?? effectiveThemeData.textColor,
+ )
+ .merge(barcodeThemeData.textStyle)
+ .merge(widget.textStyle),
+ );
return barcodeThemeData;
}
@override
void didUpdateWidget(SfBarcodeGenerator oldWidget) {
- _barcodeThemeData =
- _updateThemeData(Theme.of(context), SfBarcodeTheme.of(context));
+ _barcodeThemeData = _updateThemeData(
+ Theme.of(context),
+ SfBarcodeTheme.of(context),
+ );
if (widget.showValue &&
(oldWidget.value != widget.value ||
oldWidget.textStyle != widget.textStyle)) {
- _textSize =
- measureText(widget.value.toString(), _barcodeThemeData.textStyle!);
+ _textSize = measureText(
+ widget.value.toString(),
+ _barcodeThemeData.textStyle!,
+ );
}
if (widget.symbology != oldWidget.symbology) {
@@ -352,23 +363,26 @@ class _SfBarcodeGeneratorState extends State {
@override
Widget build(BuildContext context) {
if (widget.showValue && _textSize == null) {
- _textSize =
- measureText(widget.value.toString(), _barcodeThemeData.textStyle!);
+ _textSize = measureText(
+ widget.value.toString(),
+ _barcodeThemeData.textStyle!,
+ );
}
_symbologyRenderer.getIsValidateInput(widget.value!);
_symbologyRenderer.textSize = _textSize;
return Container(
color: widget.backgroundColor ?? _barcodeThemeData.backgroundColor,
child: SfBarcodeGeneratorRenderObjectWidget(
- value: widget.value!,
- symbology: widget.symbology,
- foregroundColor: widget.barColor ?? _barcodeThemeData.barColor,
- showText: widget.showValue,
- textSpacing: widget.textSpacing,
- textStyle: _barcodeThemeData.textStyle!,
- symbologyRenderer: _symbologyRenderer,
- textSize: _textSize,
- textAlign: widget.textAlign),
+ value: widget.value!,
+ symbology: widget.symbology,
+ foregroundColor: widget.barColor ?? _barcodeThemeData.barColor,
+ showText: widget.showValue,
+ textSpacing: widget.textSpacing,
+ textStyle: _barcodeThemeData.textStyle!,
+ symbologyRenderer: _symbologyRenderer,
+ textSize: _textSize,
+ textAlign: widget.textAlign,
+ ),
);
}
}
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/base/symbology_base.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/base/symbology_base.dart
index 408e65e8d..80760587e 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/base/symbology_base.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/base/symbology_base.dart
@@ -11,10 +11,11 @@ abstract class Symbology {
/// The arguments [module] must be non-negative and greater than 0.
///
Symbology({this.module})
- : assert(
- (module != null && module > 0) || module == null,
- 'Module must'
- ' not be a non-negative value or else it must be equal to null.');
+ : assert(
+ (module != null && module > 0) || module == null,
+ 'Module must'
+ ' not be a non-negative value or else it must be equal to null.',
+ );
/// Specifies the size of the smallest line or dot of the barcode.
///
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/common/barcode_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/common/barcode_renderer.dart
index fa961a972..d9bb362f2 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/common/barcode_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/common/barcode_renderer.dart
@@ -5,18 +5,18 @@ import '../renderers/one_dimensional/symbology_base_renderer.dart';
/// Represents the render object widget
class SfBarcodeGeneratorRenderObjectWidget extends LeafRenderObjectWidget {
/// Creates the render object widget
- const SfBarcodeGeneratorRenderObjectWidget(
- {Key? key,
- this.value,
- this.symbology,
- this.foregroundColor,
- this.showText,
- this.textSpacing,
- this.textStyle,
- this.textSize,
- this.symbologyRenderer,
- this.textAlign})
- : super(key: key);
+ const SfBarcodeGeneratorRenderObjectWidget({
+ Key? key,
+ this.value,
+ this.symbology,
+ this.foregroundColor,
+ this.showText,
+ this.textSpacing,
+ this.textStyle,
+ this.textSize,
+ this.symbologyRenderer,
+ this.textAlign,
+ }) : super(key: key);
///Defines the value of the barcode to be rendered.
final String? value;
@@ -49,15 +49,16 @@ class SfBarcodeGeneratorRenderObjectWidget extends LeafRenderObjectWidget {
@override
RenderObject createRenderObject(BuildContext context) {
return _RenderBarcode(
- value: value!,
- symbology: symbology!,
- foregroundColor: foregroundColor!,
- showText: showText!,
- textSpacing: textSpacing!,
- symbologyRenderer: symbologyRenderer!,
- textStyle: textStyle!,
- textSize: textSize,
- textAlign: textAlign!);
+ value: value!,
+ symbology: symbology!,
+ foregroundColor: foregroundColor!,
+ showText: showText!,
+ textSpacing: textSpacing!,
+ symbologyRenderer: symbologyRenderer!,
+ textStyle: textStyle!,
+ textSize: textSize,
+ textAlign: textAlign!,
+ );
}
@override
@@ -79,25 +80,25 @@ class SfBarcodeGeneratorRenderObjectWidget extends LeafRenderObjectWidget {
/// Represents the RenderBarcode class
class _RenderBarcode extends RenderBox {
/// Creates the RenderBarcode
- _RenderBarcode(
- {required String value,
- required Symbology symbology,
- required SymbologyRenderer symbologyRenderer,
- required Color foregroundColor,
- required bool showText,
- required double textSpacing,
- required TextStyle textStyle,
- Size? textSize,
- required TextAlign textAlign})
- : _value = value,
- _symbology = symbology,
- _symbologyRenderer = symbologyRenderer,
- _foregroundColor = foregroundColor,
- _showText = showText,
- _textSpacing = textSpacing,
- _textStyle = textStyle,
- _textSize = textSize,
- _textAlign = textAlign;
+ _RenderBarcode({
+ required String value,
+ required Symbology symbology,
+ required SymbologyRenderer symbologyRenderer,
+ required Color foregroundColor,
+ required bool showText,
+ required double textSpacing,
+ required TextStyle textStyle,
+ Size? textSize,
+ required TextAlign textAlign,
+ }) : _value = value,
+ _symbology = symbology,
+ _symbologyRenderer = symbologyRenderer,
+ _foregroundColor = foregroundColor,
+ _showText = showText,
+ _textSpacing = textSpacing,
+ _textStyle = textStyle,
+ _textSize = textSize,
+ _textAlign = textAlign;
/// Represents the barcode value
String _value;
@@ -245,20 +246,21 @@ class _RenderBarcode extends RenderBox {
@override
void paint(PaintingContext context, Offset offset) {
symbologyRenderer.renderBarcode(
- context.canvas,
- Size(
- size.width,
- size.height -
- (showText
- ? (_textSpacing +
- (_textSize != null ? _textSize!.height : 0))
- : 0)),
- offset,
- value,
- foregroundColor,
- textStyle,
- textSpacing,
- textAlign,
- showText);
+ context.canvas,
+ Size(
+ size.width,
+ size.height -
+ (showText
+ ? (_textSpacing + (_textSize != null ? _textSize!.height : 0))
+ : 0),
+ ),
+ offset,
+ value,
+ foregroundColor,
+ textStyle,
+ textSpacing,
+ textAlign,
+ showText,
+ );
}
}
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/one_dimensional/code128_symbology.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/one_dimensional/code128_symbology.dart
index 729d578e3..e6a412ba6 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/one_dimensional/code128_symbology.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/one_dimensional/code128_symbology.dart
@@ -18,8 +18,5 @@ class Code128 extends Symbology {
/// This is a very large method. This method could be
/// refactor to a smaller methods, but it degrades the performance.Since it
/// adds the character corresponding to this symbology is added in to the list
- Code128({int? module})
- : super(
- module: module,
- );
+ Code128({int? module}) : super(module: module);
}
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/one_dimensional/code39_extended_symbology.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/one_dimensional/code39_extended_symbology.dart
index 305fc0f65..59775e72f 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/one_dimensional/code39_extended_symbology.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/one_dimensional/code39_extended_symbology.dart
@@ -18,5 +18,5 @@ class Code39Extended extends Code39 {
/// refactored to a smaller methods, but it degrades the performance.Since it
/// adds character corresponding to this symbology is added in to the list
Code39Extended({int? module, bool? enableCheckSum})
- : super(module: module, enableCheckSum: enableCheckSum ?? true);
+ : super(module: module, enableCheckSum: enableCheckSum ?? true);
}
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/codabar_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/codabar_renderer.dart
index d4be76371..2d83daaba 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/codabar_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/codabar_renderer.dart
@@ -27,7 +27,7 @@ class CodabarRenderer extends SymbologyRenderer {
'A': '1011001001',
'B': '1001001011',
'C': '1010010011',
- 'D': '1010011001'
+ 'D': '1010011001',
};
}
@@ -43,7 +43,8 @@ class CodabarRenderer extends SymbologyRenderer {
value[i] == 'C' ||
value[i] == 'D') {
throw ArgumentError(
- 'The provided input cannot be encoded : ${value[i]}');
+ 'The provided input cannot be encoded : ${value[i]}',
+ );
}
}
return true;
@@ -51,24 +52,34 @@ class CodabarRenderer extends SymbologyRenderer {
@override
void renderBarcode(
- Canvas canvas,
- Size size,
- Offset offset,
- String value,
- Color foregroundColor,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- bool showValue) {
+ Canvas canvas,
+ Size size,
+ Offset offset,
+ String value,
+ Color foregroundColor,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ bool showValue,
+ ) {
final Paint paint = getBarPaint(foregroundColor);
final List code = _getCodeValues(value);
final int barTotalLength = _getTotalLength(code);
- double left = symbology!.module == null
- ? offset.dx
- : getLeftPosition(
- barTotalLength, symbology!.module!, size.width, offset.dx);
+ double left =
+ symbology!.module == null
+ ? offset.dx
+ : getLeftPosition(
+ barTotalLength,
+ symbology!.module!,
+ size.width,
+ offset.dx,
+ );
final Rect barCodeRect = Rect.fromLTRB(
- offset.dx, offset.dy, offset.dx + size.width, offset.dy + size.height);
+ offset.dx,
+ offset.dy,
+ offset.dx + size.width,
+ offset.dy + size.height,
+ );
double ratio = 0;
if (symbology!.module != null) {
ratio = symbology!.module!.toDouble();
@@ -91,7 +102,11 @@ class CodabarRenderer extends SymbologyRenderer {
if (canDraw &&
(left >= barCodeRect.left && left + ratio < barCodeRect.right)) {
final Rect individualBarRect = Rect.fromLTRB(
- left, offset.dy, left + ratio, offset.dy + barHeight);
+ left,
+ offset.dy,
+ left + ratio,
+ offset.dy + barHeight,
+ );
canvas.drawRect(individualBarRect, paint);
}
left += ratio;
@@ -124,8 +139,10 @@ class CodabarRenderer extends SymbologyRenderer {
/// Returns the encoded value of the provided input value
List _getCodeValues(String value) {
valueWithStartAndStopSymbol = _getValueWithStartAndStopSymbol(value);
- final List codeBarValues =
- List.filled(valueWithStartAndStopSymbol.length, null);
+ final List codeBarValues = List.filled(
+ valueWithStartAndStopSymbol.length,
+ null,
+ );
for (int i = 0; i < valueWithStartAndStopSymbol.length; i++) {
for (int j = 0; j < _codeBarMap.length; j++) {
if (valueWithStartAndStopSymbol[i] ==
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128_renderer.dart
index b153815b2..ebdb6b788 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128_renderer.dart
@@ -421,7 +421,7 @@ class Code128Renderer extends SymbologyRenderer {
[2, 1, 1, 4, 1, 2],
[2, 1, 1, 2, 1, 4],
[2, 1, 1, 2, 3, 2],
- [2, 3, 3, 1, 1, 1, 2]
+ [2, 3, 3, 1, 1, 1, 2],
];
}
@@ -439,7 +439,8 @@ class Code128Renderer extends SymbologyRenderer {
return true;
} else {
throw ArgumentError(
- 'The provided input cannot be encoded : ${value[i]}');
+ 'The provided input cannot be encoded : ${value[i]}',
+ );
}
}
return false;
@@ -454,8 +455,11 @@ class Code128Renderer extends SymbologyRenderer {
int codeTypeValue = 0;
int currentPosition = 0;
while (currentPosition < value.length) {
- final int currentCodeType =
- _getValidatedCode(currentPosition, codeTypeValue, value);
+ final int currentCodeType = _getValidatedCode(
+ currentPosition,
+ codeTypeValue,
+ value,
+ );
int currentIndex;
if (currentCodeType == codeTypeValue) {
final int currentValue = value[currentPosition].codeUnitAt(0);
@@ -484,7 +488,8 @@ class Code128Renderer extends SymbologyRenderer {
value[currentPosition].codeUnitAt(0) - ' '.codeUnitAt(0);
} else {
currentIndex = int.parse(
- value.substring(currentPosition, currentPosition + 2));
+ value.substring(currentPosition, currentPosition + 2),
+ );
currentPosition++;
}
}
@@ -526,8 +531,12 @@ class Code128Renderer extends SymbologyRenderer {
/// Method to validate the corresponding code set based on the input
int _getValidatedCode(int start, int previousCodeSet, String value) {
CodeType codeType = _getCodeType(start, value);
- final int? currentCodeType =
- _getValidatedCodeTypes(start, previousCodeSet, value, codeType);
+ final int? currentCodeType = _getValidatedCodeTypes(
+ start,
+ previousCodeSet,
+ value,
+ codeType,
+ );
if (currentCodeType != null) {
return currentCodeType;
}
@@ -569,7 +578,11 @@ class Code128Renderer extends SymbologyRenderer {
/// Method to get the validated types
int? _getValidatedCodeTypes(
- int start, int previousCodeSet, String value, CodeType codeType) {
+ int start,
+ int previousCodeSet,
+ String value,
+ CodeType codeType,
+ ) {
if (codeType == CodeType.singleDigit) {
if (previousCodeSet == _codeA) {
return _codeA;
@@ -629,22 +642,28 @@ class Code128Renderer extends SymbologyRenderer {
@override
void renderBarcode(
- Canvas canvas,
- Size size,
- Offset offset,
- String value,
- Color foregroundColor,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- bool showValue) {
+ Canvas canvas,
+ Size size,
+ Offset offset,
+ String value,
+ Color foregroundColor,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ bool showValue,
+ ) {
final Paint paint = getBarPaint(foregroundColor);
final List> encodedValue = _getEncodedValue(value);
final int totalBarLength = _getTotalBarLength(encodedValue);
- double left = symbology?.module == null
- ? offset.dx
- : getLeftPosition(
- totalBarLength, symbology?.module, size.width, offset.dx);
+ double left =
+ symbology?.module == null
+ ? offset.dx
+ : getLeftPosition(
+ totalBarLength,
+ symbology?.module,
+ size.width,
+ offset.dx,
+ );
double ratio = 0;
if (symbology?.module != null) {
ratio = symbology!.module!.toDouble();
@@ -665,7 +684,11 @@ class Code128Renderer extends SymbologyRenderer {
for (int k = 0; k < currentValue; k++) {
if (canDraw) {
final Rect individualBarRect = Rect.fromLTRB(
- left, offset.dy, left + ratio, offset.dy + size.height);
+ left,
+ offset.dy,
+ left + ratio,
+ offset.dy + size.height,
+ );
canvas.drawRect(individualBarRect, paint);
}
left += ratio;
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128a_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128a_renderer.dart
index ebfcc94b2..84713cf41 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128a_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128a_renderer.dart
@@ -11,7 +11,8 @@ class Code128ARenderer extends Code128Renderer {
for (int i = 0; i < value.length; i++) {
if (!code128ACharacterSets.contains(value[i])) {
throw ArgumentError(
- 'The provided input cannot be encoded : ${value[i]}');
+ 'The provided input cannot be encoded : ${value[i]}',
+ );
}
}
return true;
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128b_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128b_renderer.dart
index f4fd12440..83203783d 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128b_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128b_renderer.dart
@@ -11,7 +11,8 @@ class Code128BRenderer extends Code128Renderer {
for (int i = 0; i < value.length; i++) {
if (!code128BCharacterSets.contains(value[i])) {
throw ArgumentError(
- 'The provided input cannot be encoded : ${value[i]}');
+ 'The provided input cannot be encoded : ${value[i]}',
+ );
}
}
return true;
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128c_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128c_renderer.dart
index 155f410fd..3a8a7fcd5 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128c_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code128c_renderer.dart
@@ -11,7 +11,8 @@ class Code128CRenderer extends Code128Renderer {
for (int i = 0; i < value.length; i++) {
if (!code128CCharacterSets.contains(value[i])) {
throw ArgumentError(
- 'The provided input cannot be encoded : ${value[i]}');
+ 'The provided input cannot be encoded : ${value[i]}',
+ );
}
}
return true;
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code39_extended_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code39_extended_renderer.dart
index 5646a19c0..203f6207c 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code39_extended_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code39_extended_renderer.dart
@@ -146,7 +146,8 @@ class Code39ExtendedRenderer extends Code39Renderer {
for (int i = 0; i < value.length; i++) {
if (value[i].codeUnitAt(0) > 127) {
throw ArgumentError(
- 'The provided input cannot be encoded : ${value[i]}');
+ 'The provided input cannot be encoded : ${value[i]}',
+ );
}
}
return true;
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code39_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code39_renderer.dart
index 99d12b119..565b2cd0b 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code39_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code39_renderer.dart
@@ -52,7 +52,7 @@ class Code39Renderer extends SymbologyRenderer {
'121212111',
'121211121',
'121112121',
- '111212121'
+ '111212121',
];
_character = _getCode39Character();
@@ -69,7 +69,8 @@ class Code39Renderer extends SymbologyRenderer {
for (int i = 0; i < value.length; i++) {
if (!_character.contains(value[i])) {
throw ArgumentError(
- 'The provided input cannot be encoded : ${value[i]}');
+ 'The provided input cannot be encoded : ${value[i]}',
+ );
}
}
return true;
@@ -93,7 +94,9 @@ class Code39Renderer extends SymbologyRenderer {
/// Returns the pattern collection based on the provided input
List _getPatternCollection(
- String providedValue, String code39Characters) {
+ String providedValue,
+ String code39Characters,
+ ) {
final List code39Values = [];
for (int i = 0; i < providedValue.length; i++) {
final int currentIndex = code39Characters.indexOf(providedValue[i]);
@@ -104,24 +107,34 @@ class Code39Renderer extends SymbologyRenderer {
@override
void renderBarcode(
- Canvas canvas,
- Size size,
- Offset offset,
- String value,
- Color foregroundColor,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- bool showValue) {
+ Canvas canvas,
+ Size size,
+ Offset offset,
+ String value,
+ Color foregroundColor,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ bool showValue,
+ ) {
final Paint paint = getBarPaint(foregroundColor);
final List code = getCodeValues(value);
final int barTotalLength = _getTotalLength(code);
- double left = symbology?.module == null
- ? offset.dx
- : getLeftPosition(
- barTotalLength, symbology?.module, size.width, offset.dx);
+ double left =
+ symbology?.module == null
+ ? offset.dx
+ : getLeftPosition(
+ barTotalLength,
+ symbology?.module,
+ size.width,
+ offset.dx,
+ );
final Rect barCodeRect = Rect.fromLTRB(
- offset.dx, offset.dy, offset.dx + size.width, offset.dy + size.height);
+ offset.dx,
+ offset.dy,
+ offset.dx + size.width,
+ offset.dy + size.height,
+ );
double ratio = 0;
if (symbology?.module != null) {
ratio = symbology!.module!.toDouble();
@@ -144,8 +157,12 @@ class Code39Renderer extends SymbologyRenderer {
if (canDraw &&
(left >= barCodeRect.left &&
left + (currentValue * ratio) < barCodeRect.right)) {
- final Rect individualBarRect = Rect.fromLTRB(left, offset.dy,
- left + (currentValue * ratio), offset.dy + barHeight);
+ final Rect individualBarRect = Rect.fromLTRB(
+ left,
+ offset.dy,
+ left + (currentValue * ratio),
+ offset.dy + barHeight,
+ );
canvas.drawRect(individualBarRect, paint);
}
left += currentValue * ratio;
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code93_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code93_renderer.dart
index 07c206e21..ba2fce3bd 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code93_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/code93_renderer.dart
@@ -18,7 +18,8 @@ class Code93Renderer extends SymbologyRenderer {
for (int i = 0; i < value.length; i++) {
if (!_character.contains(value[i])) {
throw ArgumentError(
- 'The provided input cannot be encoded : ${value[i]}');
+ 'The provided input cannot be encoded : ${value[i]}',
+ );
}
}
return true;
@@ -132,24 +133,34 @@ class Code93Renderer extends SymbologyRenderer {
@override
void renderBarcode(
- Canvas canvas,
- Size size,
- Offset offset,
- String value,
- Color foregroundColor,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- bool showValue) {
+ Canvas canvas,
+ Size size,
+ Offset offset,
+ String value,
+ Color foregroundColor,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ bool showValue,
+ ) {
final Paint paint = getBarPaint(foregroundColor);
final List code = _getCodeValues(value);
final int barTotalLength = _getTotalLength(code);
- double left = symbology?.module == null
- ? offset.dx
- : getLeftPosition(
- barTotalLength, symbology?.module, size.width, offset.dx);
+ double left =
+ symbology?.module == null
+ ? offset.dx
+ : getLeftPosition(
+ barTotalLength,
+ symbology?.module,
+ size.width,
+ offset.dx,
+ );
final Rect barCodeRect = Rect.fromLTRB(
- offset.dx, offset.dy, offset.dx + size.width, offset.dy + size.height);
+ offset.dx,
+ offset.dy,
+ offset.dx + size.width,
+ offset.dy + size.height,
+ );
double ratio = 0;
if (symbology?.module != null) {
ratio = symbology!.module!.toDouble();
@@ -171,7 +182,11 @@ class Code93Renderer extends SymbologyRenderer {
if (canDraw &&
(left >= barCodeRect.left && left + ratio < barCodeRect.right)) {
final Rect individualBarRect = Rect.fromLTRB(
- left, offset.dy, left + ratio, offset.dy + barHeight);
+ left,
+ offset.dy,
+ left + ratio,
+ offset.dy + barHeight,
+ );
canvas.drawRect(individualBarRect, paint);
}
left += ratio;
@@ -183,8 +198,11 @@ class Code93Renderer extends SymbologyRenderer {
}
/// Represents the pattern collection based on the provided input
- List _getPatternCollection(String givenCharacter,
- Map codes, List encodingValue) {
+ List _getPatternCollection(
+ String givenCharacter,
+ Map codes,
+ List encodingValue,
+ ) {
final List codeKey = codes.keys.toList();
for (int i = 0; i < givenCharacter.length; i++) {
final int index = codeKey.indexOf(givenCharacter[i]);
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/ean13_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/ean13_renderer.dart
index f9e6599db..427c51c20 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/ean13_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/ean13_renderer.dart
@@ -18,16 +18,20 @@ class EAN13Renderer extends SymbologyRenderer {
if (int.parse(value[12]) == _getCheckSumData(value)) {
_encodedValue = value;
} else {
- throw ArgumentError('Invalid check digit at the trailing end. '
- 'Provide the valid check digit or remove it. '
- 'Since, it has been calculated automatically.');
+ throw ArgumentError(
+ 'Invalid check digit at the trailing end. '
+ 'Provide the valid check digit or remove it. '
+ 'Since, it has been calculated automatically.',
+ );
}
} else if (value.contains(RegExp(r'^(?=.*?[0-9]).{12}$'))) {
_encodedValue = value + _getCheckSumData(value).toString();
} else {
- throw ArgumentError('EAN13 supports only numeric characters. '
- 'The provided value should have 12 digits (without check digit) or'
- ' with 13 digits.');
+ throw ArgumentError(
+ 'EAN13 supports only numeric characters. '
+ 'The provided value should have 12 digits (without check digit) or'
+ ' with 13 digits.',
+ );
}
return true;
}
@@ -37,15 +41,16 @@ class EAN13Renderer extends SymbologyRenderer {
/// to be passed
@override
void renderBarcode(
- Canvas canvas,
- Size size,
- Offset offset,
- String value,
- Color foregroundColor,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- bool showValue) {
+ Canvas canvas,
+ Size size,
+ Offset offset,
+ String value,
+ Color foregroundColor,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ bool showValue,
+ ) {
/// _singleDigitValues[0] specifies left value of start digit
/// _singleDigitValues[1] specifies width of start digit
final List singleDigitValues = List.filled(2, null);
@@ -63,12 +68,21 @@ class EAN13Renderer extends SymbologyRenderer {
const int additionalWidth = 2;
singleDigitValues[1] = singleDigitValues[1]! + additionalWidth;
final double width = size.width - singleDigitValues[1]!;
- double left = symbology?.module == null
- ? offset.dx + singleDigitValues[1]!
- : getLeftPosition(barTotalLength, symbology?.module, width,
- offset.dx + singleDigitValues[1]!);
+ double left =
+ symbology?.module == null
+ ? offset.dx + singleDigitValues[1]!
+ : getLeftPosition(
+ barTotalLength,
+ symbology?.module,
+ width,
+ offset.dx + singleDigitValues[1]!,
+ );
final Rect barCodeRect = Rect.fromLTRB(
- offset.dx, offset.dy, offset.dx + size.width, offset.dy + size.height);
+ offset.dx,
+ offset.dy,
+ offset.dx + size.width,
+ offset.dy + size.height,
+ );
double ratio = 0;
if (symbology?.module != null) {
ratio = symbology!.module!.toDouble();
@@ -85,12 +99,13 @@ class EAN13Renderer extends SymbologyRenderer {
final String codeValue = code[i];
final bool hasExtraHeight = getHasExtraHeight(i, code);
final double additionalHeight = i == 2 ? 0.4 : 0.5;
- final double barHeight = hasExtraHeight
- ? size.height +
- (showValue
- ? (textSize!.height * additionalHeight) + textSpacing
- : 0)
- : size.height;
+ final double barHeight =
+ hasExtraHeight
+ ? size.height +
+ (showValue
+ ? (textSize!.height * additionalHeight) + textSpacing
+ : 0)
+ : size.height;
final int codeLength = codeValue.length;
for (int j = 0; j < codeLength; j++) {
// Draw the barcode when the current code value is 1
@@ -98,7 +113,11 @@ class EAN13Renderer extends SymbologyRenderer {
if (canDraw &&
(left >= barCodeRect.left && left + ratio < barCodeRect.right)) {
final Rect individualBarRect = Rect.fromLTRB(
- left, offset.dy, left + ratio, offset.dy + barHeight);
+ left,
+ offset.dy,
+ left + ratio,
+ offset.dy + barHeight,
+ );
canvas.drawRect(individualBarRect, paint);
}
left += ratio;
@@ -118,8 +137,17 @@ class EAN13Renderer extends SymbologyRenderer {
}
}
if (showValue) {
- _paintText(canvas, offset, size, _encodedValue, textStyle, textSpacing,
- textAlign, positions, singleDigitValues);
+ _paintText(
+ canvas,
+ offset,
+ size,
+ _encodedValue,
+ textStyle,
+ textSpacing,
+ textAlign,
+ positions,
+ singleDigitValues,
+ );
}
}
@@ -149,28 +177,28 @@ class EAN13Renderer extends SymbologyRenderer {
'L': [
// The L (left) type of encoding
'0001101', '0011001', '0010011', '0111101', '0100011',
- '0110001', '0101111', '0111011', '0110111', '0001011'
+ '0110001', '0101111', '0111011', '0110111', '0001011',
],
'G': [
// The G type of encoding
'0100111', '0110011', '0011011', '0100001', '0011101',
- '0111001', '0000101', '0010001', '0001001', '0010111'
+ '0111001', '0000101', '0010001', '0001001', '0010111',
],
'R': [
// The R (right) type of encoding
'1110010', '1100110', '1101100', '1000010', '1011100',
- '1001110', '1010000', '1000100', '1001000', '1110100'
+ '1001110', '1010000', '1000100', '1001000', '1110100',
],
'O': [
// The O (odd) encoding for UPC-E
'0001101', '0011001', '0010011', '0111101', '0100011',
- '0110001', '0101111', '0111011', '0110111', '0001011'
+ '0110001', '0101111', '0111011', '0110111', '0001011',
],
'E': [
// The E (even) encoding for UPC-E
'0100111', '0110011', '0011011', '0100001', '0011101',
- '0111001', '0000101', '0010001', '0001001', '0010111'
- ]
+ '0111001', '0000101', '0010001', '0001001', '0010111',
+ ],
};
}
@@ -196,20 +224,22 @@ class EAN13Renderer extends SymbologyRenderer {
'6': 'LGGGLL',
'7': 'LGLGLG',
'8': 'LGLGGL',
- '9': 'LGGLGL'
+ '9': 'LGGLGL',
};
}
/// Method to calculate the check sum digit
int _getCheckSumData(String value) {
- final int sum1 = 3 *
+ final int sum1 =
+ 3 *
(int.parse(value[11]) +
int.parse(value[9]) +
int.parse(value[7]) +
int.parse(value[5]) +
int.parse(value[3]) +
int.parse(value[1]));
- final int sum2 = int.parse(value[10]) +
+ final int sum2 =
+ int.parse(value[10]) +
int.parse(value[8]) +
int.parse(value[6]) +
int.parse(value[4]) +
@@ -250,15 +280,16 @@ class EAN13Renderer extends SymbologyRenderer {
/// Method to render the input value of the barcode
void _paintText(
- Canvas canvas,
- Offset offset,
- Size size,
- String value,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- List positions,
- List singleDigitValues) {
+ Canvas canvas,
+ Offset offset,
+ Size size,
+ String value,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ List positions,
+ List singleDigitValues,
+ ) {
final String value1 = value[0];
final String value2 = value.substring(1, 7);
final String value3 = value.substring(7, 13);
@@ -267,38 +298,41 @@ class EAN13Renderer extends SymbologyRenderer {
// Renders the first digit of the input
drawText(
- canvas,
- Offset(singleDigitValues[0]!, offset.dy + size.height + textSpacing),
- Size(singleDigitValues[1]!, size.height),
- value1,
- textStyle,
- textSpacing,
- textAlign,
- offset,
- size);
+ canvas,
+ Offset(singleDigitValues[0]!, offset.dy + size.height + textSpacing),
+ Size(singleDigitValues[1]!, size.height),
+ value1,
+ textStyle,
+ textSpacing,
+ textAlign,
+ offset,
+ size,
+ );
// Renders the first six digits of encoded text
drawText(
- canvas,
- Offset(positions[0]!, offset.dy),
- Size(secondTextWidth, size.height),
- value2,
- textStyle,
- textSpacing,
- textAlign,
- offset,
- size);
+ canvas,
+ Offset(positions[0]!, offset.dy),
+ Size(secondTextWidth, size.height),
+ value2,
+ textStyle,
+ textSpacing,
+ textAlign,
+ offset,
+ size,
+ );
// Renders the second six digits of encoded text
drawText(
- canvas,
- Offset(positions[2]!, offset.dy),
- Size(thirdTextWidth, size.height),
- value3,
- textStyle,
- textSpacing,
- textAlign,
- offset,
- size);
+ canvas,
+ Offset(positions[2]!, offset.dy),
+ Size(thirdTextWidth, size.height),
+ value3,
+ textStyle,
+ textSpacing,
+ textAlign,
+ offset,
+ size,
+ );
}
}
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/ean8_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/ean8_renderer.dart
index ac0d3693a..c5b8321f2 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/ean8_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/ean8_renderer.dart
@@ -17,31 +17,36 @@ class EAN8Renderer extends SymbologyRenderer {
if (int.parse(value[7]) == _getCheckSumData(value)) {
_encodedValue = value;
} else {
- throw ArgumentError('Invalid check digit at the trailing end. '
- 'Provide the valid check digit or remove it. '
- 'Since, it has been calculated automatically.');
+ throw ArgumentError(
+ 'Invalid check digit at the trailing end. '
+ 'Provide the valid check digit or remove it. '
+ 'Since, it has been calculated automatically.',
+ );
}
} else if (value.contains(RegExp(r'^(?=.*?[0-9]).{7}$'))) {
_encodedValue = value + _getCheckSumData(value).toString();
} else {
- throw ArgumentError('EAN8 supports only numeric characters.'
- ' The provided value should have 7 digits (without check digit)'
- ' or with 8 digits.');
+ throw ArgumentError(
+ 'EAN8 supports only numeric characters.'
+ ' The provided value should have 7 digits (without check digit)'
+ ' or with 8 digits.',
+ );
}
return true;
}
@override
void renderBarcode(
- Canvas canvas,
- Size size,
- Offset offset,
- String value,
- Color foregroundColor,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- bool showValue) {
+ Canvas canvas,
+ Size size,
+ Offset offset,
+ String value,
+ Color foregroundColor,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ bool showValue,
+ ) {
/// _positions[0] specifies end position of start bar
/// _positions[1] specifies start position of middle bar
/// _positions[2] specifies end position of middle bar
@@ -50,12 +55,21 @@ class EAN8Renderer extends SymbologyRenderer {
final Paint paint = getBarPaint(foregroundColor);
final List code = _getCodeValues();
final int barTotalLength = _getTotalLength(code);
- double left = symbology?.module == null
- ? offset.dx
- : getLeftPosition(
- barTotalLength, symbology?.module, size.width, offset.dx);
+ double left =
+ symbology?.module == null
+ ? offset.dx
+ : getLeftPosition(
+ barTotalLength,
+ symbology?.module,
+ size.width,
+ offset.dx,
+ );
final Rect barCodeRect = Rect.fromLTRB(
- offset.dx, offset.dy, offset.dx + size.width, offset.dy + size.height);
+ offset.dx,
+ offset.dy,
+ offset.dx + size.width,
+ offset.dy + size.height,
+ );
double ratio = 0;
if (symbology?.module != null) {
@@ -72,12 +86,13 @@ class EAN8Renderer extends SymbologyRenderer {
final String codeValue = code[i];
final bool hasExtraHeight = getHasExtraHeight(i, code);
final double additionalHeight = i == 2 ? 0.4 : 0.5;
- final double barHeight = hasExtraHeight
- ? size.height +
- (showValue
- ? (textSize!.height * additionalHeight) + textSpacing
- : 0)
- : size.height;
+ final double barHeight =
+ hasExtraHeight
+ ? size.height +
+ (showValue
+ ? (textSize!.height * additionalHeight) + textSpacing
+ : 0)
+ : size.height;
final int codeLength = codeValue.length;
for (int j = 0; j < codeLength; j++) {
// Draw the barcode when the current code value is 1
@@ -85,7 +100,11 @@ class EAN8Renderer extends SymbologyRenderer {
if (canDraw &&
(left >= barCodeRect.left && left + ratio < barCodeRect.right)) {
final Rect individualBarRect = Rect.fromLTRB(
- left, offset.dy, left + ratio, offset.dy + barHeight);
+ left,
+ offset.dy,
+ left + ratio,
+ offset.dy + barHeight,
+ );
canvas.drawRect(individualBarRect, paint);
}
left += ratio;
@@ -105,8 +124,16 @@ class EAN8Renderer extends SymbologyRenderer {
}
}
if (showValue) {
- _paintText(canvas, offset, size, _encodedValue, textStyle, textSpacing,
- textAlign, positions);
+ _paintText(
+ canvas,
+ offset,
+ size,
+ _encodedValue,
+ textStyle,
+ textSpacing,
+ textAlign,
+ positions,
+ );
}
}
@@ -138,9 +165,11 @@ class EAN8Renderer extends SymbologyRenderer {
/// Represents the encoded value for the first 6 digits of the input value
String _getLeftValue(Map codes, bool isLeft) {
String code = '';
- for (int i = isLeft ? 0 : _encodedValue.length - 4;
- i < (isLeft ? _encodedValue.length - 4 : _encodedValue.length);
- i++) {
+ for (
+ int i = isLeft ? 0 : _encodedValue.length - 4;
+ i < (isLeft ? _encodedValue.length - 4 : _encodedValue.length);
+ i++
+ ) {
final int currentValue = int.parse(_encodedValue[i]);
if (i == 0 || i == 4) {
code = codes.entries.elementAt(currentValue).value;
@@ -157,7 +186,8 @@ class EAN8Renderer extends SymbologyRenderer {
for (int i = 0; i < value.length; i++) {
final int sum1 =
int.parse(value[1]) + int.parse(value[3]) + int.parse(value[5]);
- final int sum2 = 3 *
+ final int sum2 =
+ 3 *
(int.parse(value[0]) +
int.parse(value[2]) +
int.parse(value[4]) +
@@ -196,7 +226,7 @@ class EAN8Renderer extends SymbologyRenderer {
'6': '1010000',
'7': '1000100',
'8': '1001000',
- '9': '1110100'
+ '9': '1110100',
};
}
return codes;
@@ -204,14 +234,15 @@ class EAN8Renderer extends SymbologyRenderer {
/// Method to render the input value of the barcode
void _paintText(
- Canvas canvas,
- Offset offset,
- Size size,
- String value,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- List positions) {
+ Canvas canvas,
+ Offset offset,
+ Size size,
+ String value,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ List positions,
+ ) {
final String value1 = value.substring(0, 4);
final String value2 = value.substring(4, 8);
final double firstTextWidth = positions[1]! - positions[0]!;
@@ -219,26 +250,28 @@ class EAN8Renderer extends SymbologyRenderer {
// Renders the first four digits of input
drawText(
- canvas,
- Offset(positions[0]!, offset.dy),
- Size(firstTextWidth, size.height),
- value1,
- textStyle,
- textSpacing,
- textAlign,
- offset,
- size);
+ canvas,
+ Offset(positions[0]!, offset.dy),
+ Size(firstTextWidth, size.height),
+ value1,
+ textStyle,
+ textSpacing,
+ textAlign,
+ offset,
+ size,
+ );
// Renders the last four digits of input
drawText(
- canvas,
- Offset(positions[2]!, offset.dy),
- Size(secondTextWidth, size.height),
- value2,
- textStyle,
- textSpacing,
- textAlign,
- offset,
- size);
+ canvas,
+ Offset(positions[2]!, offset.dy),
+ Size(secondTextWidth, size.height),
+ value2,
+ textStyle,
+ textSpacing,
+ textAlign,
+ offset,
+ size,
+ );
}
}
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/symbology_base_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/symbology_base_renderer.dart
index 52a29d4e0..78619c40a 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/symbology_base_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/symbology_base_renderer.dart
@@ -28,15 +28,16 @@ abstract class SymbologyRenderer {
/// Method to render the barcode value
void renderBarcode(
- Canvas canvas,
- Size size,
- Offset offset,
- String value,
- Color foregroundColor,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- bool showValue);
+ Canvas canvas,
+ Size size,
+ Offset offset,
+ String value,
+ Color foregroundColor,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ bool showValue,
+ );
/// Renders the paint for the bar code
Paint getBarPaint(Color foregroundColor) {
@@ -48,7 +49,11 @@ abstract class SymbologyRenderer {
/// Calculates the left value of the initial bar code
double getLeftPosition(
- int barWidth, int? module, double width, double offsetX) {
+ int barWidth,
+ int? module,
+ double width,
+ double offsetX,
+ ) {
final int calculatedWidth = barWidth * module!;
// Calculates the left position of the barcode based on the provided
// module value
@@ -58,12 +63,23 @@ abstract class SymbologyRenderer {
}
/// Method to render the input value of the barcode
- void drawText(Canvas canvas, Offset offset, Size size, String value,
- TextStyle textStyle, double textSpacing, TextAlign textAlign,
- [Offset? actualOffset, Size? actualSize]) {
+ void drawText(
+ Canvas canvas,
+ Offset offset,
+ Size size,
+ String value,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign, [
+ Offset? actualOffset,
+ Size? actualSize,
+ ]) {
final TextSpan span = TextSpan(text: value, style: textStyle);
final TextPainter textPainter = TextPainter(
- text: span, textDirection: TextDirection.ltr, textAlign: textAlign);
+ text: span,
+ textDirection: TextDirection.ltr,
+ textAlign: textAlign,
+ );
textPainter.layout();
double x;
double y;
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/upca_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/upca_renderer.dart
index ee6265045..cc45289ad 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/upca_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/upca_renderer.dart
@@ -20,14 +20,18 @@ class UPCARenderer extends SymbologyRenderer {
if (int.parse(value[11]) == _getCheckSumData(value)) {
_encodedValue = value;
} else {
- throw ArgumentError('Invalid check digit at the trailing end.'
- ' Provide the valid check digit or remove it.'
- ' Since, it has been calculated automatically.');
+ throw ArgumentError(
+ 'Invalid check digit at the trailing end.'
+ ' Provide the valid check digit or remove it.'
+ ' Since, it has been calculated automatically.',
+ );
}
} else {
- throw ArgumentError('UPCA supports only numeric characters. '
- 'The provided value should have 11 digits (without check digit) '
- 'or with 12 digits.');
+ throw ArgumentError(
+ 'UPCA supports only numeric characters. '
+ 'The provided value should have 11 digits (without check digit) '
+ 'or with 12 digits.',
+ );
}
return true;
}
@@ -37,15 +41,16 @@ class UPCARenderer extends SymbologyRenderer {
/// to be passed
@override
void renderBarcode(
- Canvas canvas,
- Size size,
- Offset offset,
- String value,
- Color foregroundColor,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- bool showValue) {
+ Canvas canvas,
+ Size size,
+ Offset offset,
+ String value,
+ Color foregroundColor,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ bool showValue,
+ ) {
final Paint paint = getBarPaint(foregroundColor);
final List code = _getCodeValues();
final int barTotalLength = _getTotalLength(code);
@@ -73,12 +78,21 @@ class UPCARenderer extends SymbologyRenderer {
}
final double width =
size.width - (singleDigitValues[1]! + singleDigitValues[3]!);
- double left = symbology?.module == null
- ? offset.dx + singleDigitValues[1]!
- : getLeftPosition(barTotalLength, symbology?.module, width,
- offset.dx + singleDigitValues[1]!);
+ double left =
+ symbology?.module == null
+ ? offset.dx + singleDigitValues[1]!
+ : getLeftPosition(
+ barTotalLength,
+ symbology?.module,
+ width,
+ offset.dx + singleDigitValues[1]!,
+ );
final Rect barCodeRect = Rect.fromLTRB(
- offset.dx, offset.dy, offset.dx + size.width, offset.dy + size.height);
+ offset.dx,
+ offset.dy,
+ offset.dx + size.width,
+ offset.dy + size.height,
+ );
double ratio = 0;
if (symbology?.module != null) {
ratio = symbology!.module!.toDouble();
@@ -96,19 +110,24 @@ class UPCARenderer extends SymbologyRenderer {
final String codeValue = code[i];
final bool hasExtraHeight = getHasExtraHeight(i, code);
final double additionalHeight = i == code.length - 4 ? 0.4 : 0.5;
- final double barHeight = hasExtraHeight
- ? size.height +
- (showValue
- ? (textSize!.height * additionalHeight) + textSpacing
- : 0)
- : size.height;
+ final double barHeight =
+ hasExtraHeight
+ ? size.height +
+ (showValue
+ ? (textSize!.height * additionalHeight) + textSpacing
+ : 0)
+ : size.height;
final int codeLength = codeValue.length;
for (int j = 0; j < codeLength; j++) {
final bool canDraw = codeValue[j] == '1';
if (canDraw &&
(left >= barCodeRect.left && left + ratio < barCodeRect.right)) {
final Rect individualBarRect = Rect.fromLTRB(
- left, offset.dy, left + ratio, offset.dy + barHeight);
+ left,
+ offset.dy,
+ left + ratio,
+ offset.dy + barHeight,
+ );
canvas.drawRect(individualBarRect, paint);
}
left += ratio;
@@ -136,8 +155,17 @@ class UPCARenderer extends SymbologyRenderer {
}
if (showValue) {
- _paintText(canvas, offset, size, _encodedValue, textStyle, textSpacing,
- textAlign, positions, singleDigitValues);
+ _paintText(
+ canvas,
+ offset,
+ size,
+ _encodedValue,
+ textStyle,
+ textSpacing,
+ textAlign,
+ positions,
+ singleDigitValues,
+ );
}
}
@@ -179,7 +207,7 @@ class UPCARenderer extends SymbologyRenderer {
'0101111',
'0111011',
'0110111',
- '0001011'
+ '0001011',
],
'R': [
'1110010',
@@ -191,8 +219,8 @@ class UPCARenderer extends SymbologyRenderer {
'1010000',
'1000100',
'1001000',
- '1110100'
- ]
+ '1110100',
+ ],
};
return codes;
@@ -222,14 +250,16 @@ class UPCARenderer extends SymbologyRenderer {
/// Method to calculate the check sum digit
int _getCheckSumData(String value) {
- final int sum1 = 3 *
+ final int sum1 =
+ 3 *
(int.parse(value[0]) +
int.parse(value[2]) +
int.parse(value[4]) +
int.parse(value[6]) +
int.parse(value[8]) +
int.parse(value[10]));
- final int sum2 = int.parse(value[9]) +
+ final int sum2 =
+ int.parse(value[9]) +
int.parse(value[7]) +
int.parse(value[5]) +
int.parse(value[3]) +
@@ -240,15 +270,16 @@ class UPCARenderer extends SymbologyRenderer {
/// Method to render the input value of the barcode
void _paintText(
- Canvas canvas,
- Offset offset,
- Size size,
- String value,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- List positions,
- List singleDigitValues) {
+ Canvas canvas,
+ Offset offset,
+ Size size,
+ String value,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ List positions,
+ List singleDigitValues,
+ ) {
final String value1 = value[0];
final String value2 = value.substring(1, 6);
final String value3 = value.substring(6, 11);
@@ -258,50 +289,54 @@ class UPCARenderer extends SymbologyRenderer {
// Renders the first digit of encoded value
drawText(
- canvas,
- Offset(singleDigitValues[0]!, offset.dy + size.height + textSpacing),
- Size(singleDigitValues[1]!, size.height),
- value1,
- textStyle,
- textSpacing,
- textAlign,
- offset,
- size);
+ canvas,
+ Offset(singleDigitValues[0]!, offset.dy + size.height + textSpacing),
+ Size(singleDigitValues[1]!, size.height),
+ value1,
+ textStyle,
+ textSpacing,
+ textAlign,
+ offset,
+ size,
+ );
// Renders the first five digits of encoded input value
drawText(
- canvas,
- Offset(positions[0]!, offset.dy),
- Size(secondTextWidth, size.height),
- value2,
- textStyle,
- textSpacing,
- textAlign,
- offset,
- size);
+ canvas,
+ Offset(positions[0]!, offset.dy),
+ Size(secondTextWidth, size.height),
+ value2,
+ textStyle,
+ textSpacing,
+ textAlign,
+ offset,
+ size,
+ );
// Renders the second five digits of encoded input value
drawText(
- canvas,
- Offset(positions[2]!, offset.dy),
- Size(thirdTextWidth, size.height),
- value3,
- textStyle,
- textSpacing,
- textAlign,
- offset,
- size);
+ canvas,
+ Offset(positions[2]!, offset.dy),
+ Size(thirdTextWidth, size.height),
+ value3,
+ textStyle,
+ textSpacing,
+ textAlign,
+ offset,
+ size,
+ );
// Renders the last digit of the encoded input value
drawText(
- canvas,
- Offset(singleDigitValues[2]!, offset.dy + size.height + textSpacing),
- Size(singleDigitValues[3]!, size.height),
- value[value.length - 1],
- textStyle,
- textSpacing,
- textAlign,
- offset,
- size);
+ canvas,
+ Offset(singleDigitValues[2]!, offset.dy + size.height + textSpacing),
+ Size(singleDigitValues[3]!, size.height),
+ value[value.length - 1],
+ textStyle,
+ textSpacing,
+ textAlign,
+ offset,
+ size,
+ );
}
}
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/upce_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/upce_renderer.dart
index c49b89b07..38b944db8 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/upce_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/one_dimensional/upce_renderer.dart
@@ -17,8 +17,10 @@ class UPCERenderer extends SymbologyRenderer {
if (value.contains(RegExp(r'^(?=.*?[0-9]).{6}$'))) {
return true;
}
- throw ArgumentError('UPCE supports only numeric characters. '
- 'The provided value should have 6 digits.');
+ throw ArgumentError(
+ 'UPCE supports only numeric characters. '
+ 'The provided value should have 6 digits.',
+ );
}
/// This is quite a large method. This method could not be
@@ -26,15 +28,16 @@ class UPCERenderer extends SymbologyRenderer {
/// to be passed
@override
void renderBarcode(
- Canvas canvas,
- Size size,
- Offset offset,
- String value,
- Color foregroundColor,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- bool showValue) {
+ Canvas canvas,
+ Size size,
+ Offset offset,
+ String value,
+ Color foregroundColor,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ bool showValue,
+ ) {
final Paint paint = getBarPaint(foregroundColor);
final List code = _getCodeValues(value);
final int barTotalLength = _getTotalLength(code);
@@ -61,12 +64,21 @@ class UPCERenderer extends SymbologyRenderer {
final double width =
size.width - (singleDigitValues[1]! + singleDigitValues[3]!);
- double left = symbology?.module == null
- ? offset.dx
- : getLeftPosition(barTotalLength, symbology?.module, width,
- offset.dx + singleDigitValues[1]!);
+ double left =
+ symbology?.module == null
+ ? offset.dx
+ : getLeftPosition(
+ barTotalLength,
+ symbology?.module,
+ width,
+ offset.dx + singleDigitValues[1]!,
+ );
final Rect barCodeRect = Rect.fromLTRB(
- offset.dx, offset.dy, offset.dx + size.width, offset.dy + size.height);
+ offset.dx,
+ offset.dy,
+ offset.dx + size.width,
+ offset.dy + size.height,
+ );
double ratio = 0;
if (symbology?.module != null) {
ratio = symbology!.module!.toDouble();
@@ -81,17 +93,22 @@ class UPCERenderer extends SymbologyRenderer {
for (int i = 0; i < code.length; i++) {
final String codeValue = code[i];
final bool hasExtraHeight = getHasExtraHeight(i, code);
- final double barHeight = hasExtraHeight
- ? size.height +
- (showValue ? (textSize!.height * 0.5) + textSpacing : 0)
- : size.height;
+ final double barHeight =
+ hasExtraHeight
+ ? size.height +
+ (showValue ? (textSize!.height * 0.5) + textSpacing : 0)
+ : size.height;
final int codeLength = codeValue.length;
for (int j = 0; j < codeLength; j++) {
final bool canDraw = codeValue[j] == '1';
if (canDraw &&
(left >= barCodeRect.left && left + ratio < barCodeRect.right)) {
final Rect individualBarRect = Rect.fromLTRB(
- left, offset.dy, left + ratio, offset.dy + barHeight);
+ left,
+ offset.dy,
+ left + ratio,
+ offset.dy + barHeight,
+ );
canvas.drawRect(individualBarRect, paint);
}
@@ -113,22 +130,32 @@ class UPCERenderer extends SymbologyRenderer {
}
}
if (showValue) {
- _paintText(canvas, offset, size, _encodedValue, textStyle, textSpacing,
- textAlign, positions, singleDigitValues);
+ _paintText(
+ canvas,
+ offset,
+ size,
+ _encodedValue,
+ textStyle,
+ textSpacing,
+ textAlign,
+ positions,
+ singleDigitValues,
+ );
}
}
/// Method to render the input value of the barcode
void _paintText(
- Canvas canvas,
- Offset offset,
- Size size,
- String value,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- List positions,
- List singleDigitValues) {
+ Canvas canvas,
+ Offset offset,
+ Size size,
+ String value,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ List positions,
+ List singleDigitValues,
+ ) {
const String value1 = '0';
final String value2 = value.substring(1, 7);
@@ -136,37 +163,40 @@ class UPCERenderer extends SymbologyRenderer {
// Renders the first digit of encoded value
drawText(
- canvas,
- Offset(singleDigitValues[0]!, offset.dy + size.height + textSpacing),
- Size(singleDigitValues[1]!, size.height),
- value1,
- textStyle,
- textSpacing,
- textAlign,
- offset,
- size);
+ canvas,
+ Offset(singleDigitValues[0]!, offset.dy + size.height + textSpacing),
+ Size(singleDigitValues[1]!, size.height),
+ value1,
+ textStyle,
+ textSpacing,
+ textAlign,
+ offset,
+ size,
+ );
//Renders the middle six digits of encoded value
drawText(
- canvas,
- Offset(positions[0]!, offset.dy),
- Size(secondTextWidth, size.height),
- value2,
- textStyle,
- textSpacing,
- textAlign,
- offset,
- size);
+ canvas,
+ Offset(positions[0]!, offset.dy),
+ Size(secondTextWidth, size.height),
+ value2,
+ textStyle,
+ textSpacing,
+ textAlign,
+ offset,
+ size,
+ );
// Renders the last digit of encoded value
drawText(
- canvas,
- Offset(singleDigitValues[2]!, offset.dy + size.height + textSpacing),
- Size(singleDigitValues[3]!, size.height),
- value[value.length - 1],
- textStyle,
- textSpacing,
- textAlign,
- offset,
- size);
+ canvas,
+ Offset(singleDigitValues[2]!, offset.dy + size.height + textSpacing),
+ Size(singleDigitValues[3]!, size.height),
+ value[value.length - 1],
+ textStyle,
+ textSpacing,
+ textAlign,
+ offset,
+ size,
+ );
}
/// Calculate the total length from given value
@@ -203,7 +233,7 @@ class UPCERenderer extends SymbologyRenderer {
'6': 'EOOOEE',
'7': 'EOEOEO',
'8': 'EOEOOE',
- '9': 'EOOEOE'
+ '9': 'EOOEOE',
};
return upceSymbology;
}
@@ -220,7 +250,7 @@ class UPCERenderer extends SymbologyRenderer {
'XXXXX00006',
'XXXXX00007',
'XXXXX00008',
- 'XXXXX00009'
+ 'XXXXX00009',
];
}
@@ -266,13 +296,13 @@ class UPCERenderer extends SymbologyRenderer {
'0101111',
'0111011',
'0110111',
- '0001011'
+ '0001011',
],
'E': [
// The E (even) encoding for UPC-E
'0100111', '0110011', '0011011', '0100001', '0011101',
- '0111001', '0000101', '0010001', '0001001', '0010111'
- ]
+ '0111001', '0000101', '0010001', '0001001', '0010111',
+ ],
};
}
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/datamatrix_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/datamatrix_renderer.dart
index cfc22f547..b4781413b 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/datamatrix_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/datamatrix_renderer.dart
@@ -54,277 +54,307 @@ class DataMatrixRenderer extends SymbologyRenderer {
void _initialize() {
_symbolAttributes = <_DataMatrixSymbolAttribute>[
_DataMatrixSymbolAttribute(
- symbolRow: 10,
- symbolColumn: 10,
- horizontalDataRegion: 1,
- verticalDataRegion: 1,
- dataCodeWords: 3,
- correctionCodeWords: 5,
- interLeavedBlock: 1,
- interLeavedDataBlock: 3),
+ symbolRow: 10,
+ symbolColumn: 10,
+ horizontalDataRegion: 1,
+ verticalDataRegion: 1,
+ dataCodeWords: 3,
+ correctionCodeWords: 5,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 3,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 12,
- symbolColumn: 12,
- horizontalDataRegion: 1,
- verticalDataRegion: 1,
- dataCodeWords: 5,
- correctionCodeWords: 7,
- interLeavedBlock: 1,
- interLeavedDataBlock: 5),
+ symbolRow: 12,
+ symbolColumn: 12,
+ horizontalDataRegion: 1,
+ verticalDataRegion: 1,
+ dataCodeWords: 5,
+ correctionCodeWords: 7,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 5,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 14,
- symbolColumn: 14,
- horizontalDataRegion: 1,
- verticalDataRegion: 1,
- dataCodeWords: 8,
- correctionCodeWords: 10,
- interLeavedBlock: 1,
- interLeavedDataBlock: 8),
+ symbolRow: 14,
+ symbolColumn: 14,
+ horizontalDataRegion: 1,
+ verticalDataRegion: 1,
+ dataCodeWords: 8,
+ correctionCodeWords: 10,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 8,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 16,
- symbolColumn: 16,
- horizontalDataRegion: 1,
- verticalDataRegion: 1,
- dataCodeWords: 12,
- correctionCodeWords: 12,
- interLeavedBlock: 1,
- interLeavedDataBlock: 12),
+ symbolRow: 16,
+ symbolColumn: 16,
+ horizontalDataRegion: 1,
+ verticalDataRegion: 1,
+ dataCodeWords: 12,
+ correctionCodeWords: 12,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 12,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 18,
- symbolColumn: 18,
- horizontalDataRegion: 1,
- verticalDataRegion: 1,
- dataCodeWords: 18,
- correctionCodeWords: 14,
- interLeavedBlock: 1,
- interLeavedDataBlock: 18),
+ symbolRow: 18,
+ symbolColumn: 18,
+ horizontalDataRegion: 1,
+ verticalDataRegion: 1,
+ dataCodeWords: 18,
+ correctionCodeWords: 14,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 18,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 20,
- symbolColumn: 20,
- horizontalDataRegion: 1,
- verticalDataRegion: 1,
- dataCodeWords: 22,
- correctionCodeWords: 18,
- interLeavedBlock: 1,
- interLeavedDataBlock: 22),
+ symbolRow: 20,
+ symbolColumn: 20,
+ horizontalDataRegion: 1,
+ verticalDataRegion: 1,
+ dataCodeWords: 22,
+ correctionCodeWords: 18,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 22,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 22,
- symbolColumn: 22,
- horizontalDataRegion: 1,
- verticalDataRegion: 1,
- dataCodeWords: 30,
- correctionCodeWords: 20,
- interLeavedBlock: 1,
- interLeavedDataBlock: 30),
+ symbolRow: 22,
+ symbolColumn: 22,
+ horizontalDataRegion: 1,
+ verticalDataRegion: 1,
+ dataCodeWords: 30,
+ correctionCodeWords: 20,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 30,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 24,
- symbolColumn: 24,
- horizontalDataRegion: 1,
- verticalDataRegion: 1,
- dataCodeWords: 36,
- correctionCodeWords: 24,
- interLeavedBlock: 1,
- interLeavedDataBlock: 36),
+ symbolRow: 24,
+ symbolColumn: 24,
+ horizontalDataRegion: 1,
+ verticalDataRegion: 1,
+ dataCodeWords: 36,
+ correctionCodeWords: 24,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 36,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 26,
- symbolColumn: 26,
- horizontalDataRegion: 1,
- verticalDataRegion: 1,
- dataCodeWords: 44,
- correctionCodeWords: 28,
- interLeavedBlock: 1,
- interLeavedDataBlock: 44),
+ symbolRow: 26,
+ symbolColumn: 26,
+ horizontalDataRegion: 1,
+ verticalDataRegion: 1,
+ dataCodeWords: 44,
+ correctionCodeWords: 28,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 44,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 32,
- symbolColumn: 32,
- horizontalDataRegion: 2,
- verticalDataRegion: 2,
- dataCodeWords: 62,
- correctionCodeWords: 36,
- interLeavedBlock: 1,
- interLeavedDataBlock: 62),
+ symbolRow: 32,
+ symbolColumn: 32,
+ horizontalDataRegion: 2,
+ verticalDataRegion: 2,
+ dataCodeWords: 62,
+ correctionCodeWords: 36,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 62,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 36,
- symbolColumn: 36,
- horizontalDataRegion: 2,
- verticalDataRegion: 2,
- dataCodeWords: 86,
- correctionCodeWords: 42,
- interLeavedBlock: 1,
- interLeavedDataBlock: 86),
+ symbolRow: 36,
+ symbolColumn: 36,
+ horizontalDataRegion: 2,
+ verticalDataRegion: 2,
+ dataCodeWords: 86,
+ correctionCodeWords: 42,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 86,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 40,
- symbolColumn: 40,
- horizontalDataRegion: 2,
- verticalDataRegion: 2,
- dataCodeWords: 114,
- correctionCodeWords: 48,
- interLeavedBlock: 1,
- interLeavedDataBlock: 114),
+ symbolRow: 40,
+ symbolColumn: 40,
+ horizontalDataRegion: 2,
+ verticalDataRegion: 2,
+ dataCodeWords: 114,
+ correctionCodeWords: 48,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 114,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 44,
- symbolColumn: 44,
- horizontalDataRegion: 2,
- verticalDataRegion: 2,
- dataCodeWords: 144,
- correctionCodeWords: 56,
- interLeavedBlock: 1,
- interLeavedDataBlock: 144),
+ symbolRow: 44,
+ symbolColumn: 44,
+ horizontalDataRegion: 2,
+ verticalDataRegion: 2,
+ dataCodeWords: 144,
+ correctionCodeWords: 56,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 144,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 48,
- symbolColumn: 48,
- horizontalDataRegion: 2,
- verticalDataRegion: 2,
- dataCodeWords: 174,
- correctionCodeWords: 68,
- interLeavedBlock: 1,
- interLeavedDataBlock: 174),
+ symbolRow: 48,
+ symbolColumn: 48,
+ horizontalDataRegion: 2,
+ verticalDataRegion: 2,
+ dataCodeWords: 174,
+ correctionCodeWords: 68,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 174,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 52,
- symbolColumn: 52,
- horizontalDataRegion: 2,
- verticalDataRegion: 2,
- dataCodeWords: 204,
- correctionCodeWords: 84,
- interLeavedBlock: 2,
- interLeavedDataBlock: 102),
+ symbolRow: 52,
+ symbolColumn: 52,
+ horizontalDataRegion: 2,
+ verticalDataRegion: 2,
+ dataCodeWords: 204,
+ correctionCodeWords: 84,
+ interLeavedBlock: 2,
+ interLeavedDataBlock: 102,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 64,
- symbolColumn: 64,
- horizontalDataRegion: 4,
- verticalDataRegion: 4,
- dataCodeWords: 280,
- correctionCodeWords: 112,
- interLeavedBlock: 2,
- interLeavedDataBlock: 140),
+ symbolRow: 64,
+ symbolColumn: 64,
+ horizontalDataRegion: 4,
+ verticalDataRegion: 4,
+ dataCodeWords: 280,
+ correctionCodeWords: 112,
+ interLeavedBlock: 2,
+ interLeavedDataBlock: 140,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 72,
- symbolColumn: 72,
- horizontalDataRegion: 4,
- verticalDataRegion: 4,
- dataCodeWords: 368,
- correctionCodeWords: 144,
- interLeavedBlock: 4,
- interLeavedDataBlock: 92),
+ symbolRow: 72,
+ symbolColumn: 72,
+ horizontalDataRegion: 4,
+ verticalDataRegion: 4,
+ dataCodeWords: 368,
+ correctionCodeWords: 144,
+ interLeavedBlock: 4,
+ interLeavedDataBlock: 92,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 80,
- symbolColumn: 80,
- horizontalDataRegion: 4,
- verticalDataRegion: 4,
- dataCodeWords: 456,
- correctionCodeWords: 192,
- interLeavedBlock: 4,
- interLeavedDataBlock: 114),
+ symbolRow: 80,
+ symbolColumn: 80,
+ horizontalDataRegion: 4,
+ verticalDataRegion: 4,
+ dataCodeWords: 456,
+ correctionCodeWords: 192,
+ interLeavedBlock: 4,
+ interLeavedDataBlock: 114,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 88,
- symbolColumn: 88,
- horizontalDataRegion: 4,
- verticalDataRegion: 4,
- dataCodeWords: 576,
- correctionCodeWords: 224,
- interLeavedBlock: 4,
- interLeavedDataBlock: 144),
+ symbolRow: 88,
+ symbolColumn: 88,
+ horizontalDataRegion: 4,
+ verticalDataRegion: 4,
+ dataCodeWords: 576,
+ correctionCodeWords: 224,
+ interLeavedBlock: 4,
+ interLeavedDataBlock: 144,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 96,
- symbolColumn: 96,
- horizontalDataRegion: 4,
- verticalDataRegion: 4,
- dataCodeWords: 696,
- correctionCodeWords: 272,
- interLeavedBlock: 4,
- interLeavedDataBlock: 174),
+ symbolRow: 96,
+ symbolColumn: 96,
+ horizontalDataRegion: 4,
+ verticalDataRegion: 4,
+ dataCodeWords: 696,
+ correctionCodeWords: 272,
+ interLeavedBlock: 4,
+ interLeavedDataBlock: 174,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 104,
- symbolColumn: 104,
- horizontalDataRegion: 4,
- verticalDataRegion: 4,
- dataCodeWords: 816,
- correctionCodeWords: 336,
- interLeavedBlock: 6,
- interLeavedDataBlock: 136),
+ symbolRow: 104,
+ symbolColumn: 104,
+ horizontalDataRegion: 4,
+ verticalDataRegion: 4,
+ dataCodeWords: 816,
+ correctionCodeWords: 336,
+ interLeavedBlock: 6,
+ interLeavedDataBlock: 136,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 120,
- symbolColumn: 120,
- horizontalDataRegion: 6,
- verticalDataRegion: 6,
- dataCodeWords: 1050,
- correctionCodeWords: 408,
- interLeavedBlock: 6,
- interLeavedDataBlock: 175),
+ symbolRow: 120,
+ symbolColumn: 120,
+ horizontalDataRegion: 6,
+ verticalDataRegion: 6,
+ dataCodeWords: 1050,
+ correctionCodeWords: 408,
+ interLeavedBlock: 6,
+ interLeavedDataBlock: 175,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 132,
- symbolColumn: 132,
- horizontalDataRegion: 6,
- verticalDataRegion: 6,
- dataCodeWords: 1304,
- correctionCodeWords: 496,
- interLeavedBlock: 8,
- interLeavedDataBlock: 163),
+ symbolRow: 132,
+ symbolColumn: 132,
+ horizontalDataRegion: 6,
+ verticalDataRegion: 6,
+ dataCodeWords: 1304,
+ correctionCodeWords: 496,
+ interLeavedBlock: 8,
+ interLeavedDataBlock: 163,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 144,
- symbolColumn: 144,
- horizontalDataRegion: 6,
- verticalDataRegion: 6,
- dataCodeWords: 1558,
- correctionCodeWords: 620,
- interLeavedBlock: 10,
- interLeavedDataBlock: 156),
+ symbolRow: 144,
+ symbolColumn: 144,
+ horizontalDataRegion: 6,
+ verticalDataRegion: 6,
+ dataCodeWords: 1558,
+ correctionCodeWords: 620,
+ interLeavedBlock: 10,
+ interLeavedDataBlock: 156,
+ ),
// Rectangle matrix
_DataMatrixSymbolAttribute(
- symbolRow: 8,
- symbolColumn: 18,
- horizontalDataRegion: 1,
- verticalDataRegion: 1,
- dataCodeWords: 5,
- correctionCodeWords: 7,
- interLeavedBlock: 1,
- interLeavedDataBlock: 5),
+ symbolRow: 8,
+ symbolColumn: 18,
+ horizontalDataRegion: 1,
+ verticalDataRegion: 1,
+ dataCodeWords: 5,
+ correctionCodeWords: 7,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 5,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 8,
- symbolColumn: 32,
- horizontalDataRegion: 2,
- verticalDataRegion: 1,
- dataCodeWords: 10,
- correctionCodeWords: 11,
- interLeavedBlock: 1,
- interLeavedDataBlock: 10),
+ symbolRow: 8,
+ symbolColumn: 32,
+ horizontalDataRegion: 2,
+ verticalDataRegion: 1,
+ dataCodeWords: 10,
+ correctionCodeWords: 11,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 10,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 12,
- symbolColumn: 26,
- horizontalDataRegion: 1,
- verticalDataRegion: 1,
- dataCodeWords: 16,
- correctionCodeWords: 14,
- interLeavedBlock: 1,
- interLeavedDataBlock: 16),
+ symbolRow: 12,
+ symbolColumn: 26,
+ horizontalDataRegion: 1,
+ verticalDataRegion: 1,
+ dataCodeWords: 16,
+ correctionCodeWords: 14,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 16,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 12,
- symbolColumn: 36,
- horizontalDataRegion: 2,
- verticalDataRegion: 1,
- dataCodeWords: 22,
- correctionCodeWords: 18,
- interLeavedBlock: 1,
- interLeavedDataBlock: 22),
+ symbolRow: 12,
+ symbolColumn: 36,
+ horizontalDataRegion: 2,
+ verticalDataRegion: 1,
+ dataCodeWords: 22,
+ correctionCodeWords: 18,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 22,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 16,
- symbolColumn: 36,
- horizontalDataRegion: 2,
- verticalDataRegion: 1,
- dataCodeWords: 32,
- correctionCodeWords: 24,
- interLeavedBlock: 1,
- interLeavedDataBlock: 32),
+ symbolRow: 16,
+ symbolColumn: 36,
+ horizontalDataRegion: 2,
+ verticalDataRegion: 1,
+ dataCodeWords: 32,
+ correctionCodeWords: 24,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 32,
+ ),
_DataMatrixSymbolAttribute(
- symbolRow: 16,
- symbolColumn: 48,
- horizontalDataRegion: 2,
- verticalDataRegion: 1,
- dataCodeWords: 49,
- correctionCodeWords: 28,
- interLeavedBlock: 1,
- interLeavedDataBlock: 49)
+ symbolRow: 16,
+ symbolColumn: 48,
+ horizontalDataRegion: 2,
+ verticalDataRegion: 1,
+ dataCodeWords: 49,
+ correctionCodeWords: 28,
+ interLeavedBlock: 1,
+ interLeavedDataBlock: 49,
+ ),
];
_createLogList();
@@ -393,9 +423,10 @@ class DataMatrixRenderer extends SymbologyRenderer {
if (v == 1 ||
v > 7 && (codeword[(v >> 3) - 1]! & (1 << (v & 7))) != 0) {
matrix[(1 + y + 2 * (y ~/ (fieldHeight - 2))) * width +
- 1 +
- x +
- 2 * (x ~/ (fieldWidth - 2))] = 1;
+ 1 +
+ x +
+ 2 * (x ~/ (fieldWidth - 2))] =
+ 1;
}
}
}
@@ -409,7 +440,9 @@ class DataMatrixRenderer extends SymbologyRenderer {
symbolRow = _symbolAttribute.symbolRow!;
final List> tempArray = List>.generate(
- symbolColumn, (int j) => List.filled(symbolRow, null));
+ symbolColumn,
+ (int j) => List.filled(symbolRow, null),
+ );
for (int m = 0; m < symbolColumn; m++) {
for (int n = 0; n < symbolRow; n++) {
@@ -418,7 +451,9 @@ class DataMatrixRenderer extends SymbologyRenderer {
}
final List> tempArray2 = List>.generate(
- symbolRow, (int j) => List.filled(symbolColumn, null));
+ symbolRow,
+ (int j) => List.filled(symbolColumn, null),
+ );
for (int i = 0; i < symbolRow; i++) {
for (int j = 0; j < symbolColumn; j++) {
@@ -434,8 +469,10 @@ class DataMatrixRenderer extends SymbologyRenderer {
const int quietZone = 1;
final int w = _symbolAttribute.symbolRow! + (2 * quietZone);
final int h = _symbolAttribute.symbolColumn! + (2 * quietZone);
- _dataMatrixList =
- List>.generate(w, (int j) => List.filled(h, null));
+ _dataMatrixList = List>.generate(
+ w,
+ (int j) => List.filled(h, null),
+ );
// Top quietzone.
for (int i = 0; i < h; i++) {
_dataMatrixList[0][i] = 0;
@@ -458,8 +495,15 @@ class DataMatrixRenderer extends SymbologyRenderer {
}
/// Method to encode the error correcting code word
- void _errorCorrectingCode200PlacementBit(List array, int numOfRows,
- int numOfColumns, int row, int column, int place, String character) {
+ void _errorCorrectingCode200PlacementBit(
+ List array,
+ int numOfRows,
+ int numOfColumns,
+ int row,
+ int column,
+ int place,
+ String character,
+ ) {
if (row < 0) {
row += numOfRows;
column += 4 - ((numOfRows + 4) % 8);
@@ -475,112 +519,417 @@ class DataMatrixRenderer extends SymbologyRenderer {
/// Method to encode the error correcting code word
void _errorCorrectingCode200PlacementCornerA(
- List array, int numOfRows, int numOfColumns, int place) {
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns,
- numOfRows - 1, 0, place, String.fromCharCode(7));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns,
- numOfRows - 1, 1, place, String.fromCharCode(6));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns,
- numOfRows - 1, 2, place, String.fromCharCode(5));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 0,
- numOfColumns - 2, place, String.fromCharCode(4));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 0,
- numOfColumns - 1, place, String.fromCharCode(3));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 1,
- numOfColumns - 1, place, String.fromCharCode(2));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 2,
- numOfColumns - 1, place, String.fromCharCode(1));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 3,
- numOfColumns - 1, place, String.fromCharCode(0));
+ List array,
+ int numOfRows,
+ int numOfColumns,
+ int place,
+ ) {
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ numOfRows - 1,
+ 0,
+ place,
+ String.fromCharCode(7),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ numOfRows - 1,
+ 1,
+ place,
+ String.fromCharCode(6),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ numOfRows - 1,
+ 2,
+ place,
+ String.fromCharCode(5),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 0,
+ numOfColumns - 2,
+ place,
+ String.fromCharCode(4),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 0,
+ numOfColumns - 1,
+ place,
+ String.fromCharCode(3),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 1,
+ numOfColumns - 1,
+ place,
+ String.fromCharCode(2),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 2,
+ numOfColumns - 1,
+ place,
+ String.fromCharCode(1),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 3,
+ numOfColumns - 1,
+ place,
+ String.fromCharCode(0),
+ );
}
/// Method to encode the error correcting code word
void _errorCorrectingCode200PlacementCornerB(
- List array, int numOfRows, int numOfColumns, int place) {
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns,
- numOfRows - 3, 0, place, String.fromCharCode(7));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns,
- numOfRows - 2, 0, place, String.fromCharCode(6));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns,
- numOfRows - 1, 0, place, String.fromCharCode(5));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 0,
- numOfColumns - 4, place, String.fromCharCode(4));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 0,
- numOfColumns - 3, place, String.fromCharCode(3));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 0,
- numOfColumns - 2, place, String.fromCharCode(2));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 0,
- numOfColumns - 1, place, String.fromCharCode(1));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 1,
- numOfColumns - 1, place, String.fromCharCode(0));
+ List array,
+ int numOfRows,
+ int numOfColumns,
+ int place,
+ ) {
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ numOfRows - 3,
+ 0,
+ place,
+ String.fromCharCode(7),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ numOfRows - 2,
+ 0,
+ place,
+ String.fromCharCode(6),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ numOfRows - 1,
+ 0,
+ place,
+ String.fromCharCode(5),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 0,
+ numOfColumns - 4,
+ place,
+ String.fromCharCode(4),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 0,
+ numOfColumns - 3,
+ place,
+ String.fromCharCode(3),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 0,
+ numOfColumns - 2,
+ place,
+ String.fromCharCode(2),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 0,
+ numOfColumns - 1,
+ place,
+ String.fromCharCode(1),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 1,
+ numOfColumns - 1,
+ place,
+ String.fromCharCode(0),
+ );
}
/// Method to encode the error correcting code word
void _errorCorrectingCode200PlacementCornerC(
- List array, int numOfRows, int numOfColumns, int place) {
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns,
- numOfRows - 3, 0, place, String.fromCharCode(7));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns,
- numOfRows - 2, 0, place, String.fromCharCode(6));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns,
- numOfRows - 1, 0, place, String.fromCharCode(5));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 0,
- numOfColumns - 2, place, String.fromCharCode(4));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 0,
- numOfColumns - 1, place, String.fromCharCode(3));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 1,
- numOfColumns - 1, place, String.fromCharCode(2));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 2,
- numOfColumns - 1, place, String.fromCharCode(1));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 3,
- numOfColumns - 1, place, String.fromCharCode(0));
+ List array,
+ int numOfRows,
+ int numOfColumns,
+ int place,
+ ) {
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ numOfRows - 3,
+ 0,
+ place,
+ String.fromCharCode(7),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ numOfRows - 2,
+ 0,
+ place,
+ String.fromCharCode(6),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ numOfRows - 1,
+ 0,
+ place,
+ String.fromCharCode(5),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 0,
+ numOfColumns - 2,
+ place,
+ String.fromCharCode(4),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 0,
+ numOfColumns - 1,
+ place,
+ String.fromCharCode(3),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 1,
+ numOfColumns - 1,
+ place,
+ String.fromCharCode(2),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 2,
+ numOfColumns - 1,
+ place,
+ String.fromCharCode(1),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 3,
+ numOfColumns - 1,
+ place,
+ String.fromCharCode(0),
+ );
}
/// Method to encode the error correcting code word
void _errorCorrectingCode200PlacementCornerD(
- List array, int numOfRows, int numOfColumns, int place) {
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns,
- numOfRows - 1, 0, place, String.fromCharCode(7));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns,
- numOfRows - 1, numOfColumns - 1, place, String.fromCharCode(6));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 0,
- numOfColumns - 3, place, String.fromCharCode(5));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 0,
- numOfColumns - 2, place, String.fromCharCode(4));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 0,
- numOfColumns - 1, place, String.fromCharCode(3));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 1,
- numOfColumns - 3, place, String.fromCharCode(2));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 1,
- numOfColumns - 2, place, String.fromCharCode(1));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, 1,
- numOfColumns - 1, place, String.fromCharCode(0));
+ List array,
+ int numOfRows,
+ int numOfColumns,
+ int place,
+ ) {
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ numOfRows - 1,
+ 0,
+ place,
+ String.fromCharCode(7),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ numOfRows - 1,
+ numOfColumns - 1,
+ place,
+ String.fromCharCode(6),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 0,
+ numOfColumns - 3,
+ place,
+ String.fromCharCode(5),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 0,
+ numOfColumns - 2,
+ place,
+ String.fromCharCode(4),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 0,
+ numOfColumns - 1,
+ place,
+ String.fromCharCode(3),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 1,
+ numOfColumns - 3,
+ place,
+ String.fromCharCode(2),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 1,
+ numOfColumns - 2,
+ place,
+ String.fromCharCode(1),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ 1,
+ numOfColumns - 1,
+ place,
+ String.fromCharCode(0),
+ );
}
/// Method to encode the error correcting code word
- void _errorCorrectingCode200PlacementBlock(List array, int numOfRows,
- int numOfColumns, int row, int column, int place) {
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, row - 2,
- column - 2, place, String.fromCharCode(7));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, row - 2,
- column - 1, place, String.fromCharCode(6));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, row - 1,
- column - 2, place, String.fromCharCode(5));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, row - 1,
- column - 1, place, String.fromCharCode(4));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, row - 1,
- column, place, String.fromCharCode(3));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, row,
- column - 2, place, String.fromCharCode(2));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, row,
- column - 1, place, String.fromCharCode(1));
- _errorCorrectingCode200PlacementBit(array, numOfRows, numOfColumns, row,
- column, place, String.fromCharCode(0));
+ void _errorCorrectingCode200PlacementBlock(
+ List array,
+ int numOfRows,
+ int numOfColumns,
+ int row,
+ int column,
+ int place,
+ ) {
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ row - 2,
+ column - 2,
+ place,
+ String.fromCharCode(7),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ row - 2,
+ column - 1,
+ place,
+ String.fromCharCode(6),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ row - 1,
+ column - 2,
+ place,
+ String.fromCharCode(5),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ row - 1,
+ column - 1,
+ place,
+ String.fromCharCode(4),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ row - 1,
+ column,
+ place,
+ String.fromCharCode(3),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ row,
+ column - 2,
+ place,
+ String.fromCharCode(2),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ row,
+ column - 1,
+ place,
+ String.fromCharCode(1),
+ );
+ _errorCorrectingCode200PlacementBit(
+ array,
+ numOfRows,
+ numOfColumns,
+ row,
+ column,
+ place,
+ String.fromCharCode(0),
+ );
}
/// Method to encode the error correcting code word
void _errorCorrectingCode200Placement(
- List array, int numOfRows, int numOfColumns) {
+ List array,
+ int numOfRows,
+ int numOfColumns,
+ ) {
int row, column, place;
for (row = 0; row < numOfRows; row++) {
for (column = 0; column < numOfColumns; column++) {
@@ -594,24 +943,40 @@ class DataMatrixRenderer extends SymbologyRenderer {
do {
if (row == numOfRows && !(column != 0)) {
_errorCorrectingCode200PlacementCornerA(
- array, numOfRows, numOfColumns, place++);
+ array,
+ numOfRows,
+ numOfColumns,
+ place++,
+ );
}
if ((row == numOfRows - 2) &&
!(column != 0) &&
((numOfColumns % 4) != 0)) {
_errorCorrectingCode200PlacementCornerB(
- array, numOfRows, numOfColumns, place++);
+ array,
+ numOfRows,
+ numOfColumns,
+ place++,
+ );
}
if (row == numOfRows - 2 && !(column != 0) && (numOfColumns % 8) == 4) {
_errorCorrectingCode200PlacementCornerC(
- array, numOfRows, numOfColumns, place++);
+ array,
+ numOfRows,
+ numOfColumns,
+ place++,
+ );
}
if (row == numOfRows + 4 && column == 2 && !((numOfColumns % 8) != 0)) {
_errorCorrectingCode200PlacementCornerD(
- array, numOfRows, numOfColumns, place++);
+ array,
+ numOfRows,
+ numOfColumns,
+ place++,
+ );
}
// enocoding placement (up/right)
do {
@@ -619,7 +984,13 @@ class DataMatrixRenderer extends SymbologyRenderer {
column >= 0 &&
!(array[row * numOfColumns + column] != 0)) {
_errorCorrectingCode200PlacementBlock(
- array, numOfRows, numOfColumns, row, column, place++);
+ array,
+ numOfRows,
+ numOfColumns,
+ row,
+ column,
+ place++,
+ );
}
row -= 2;
@@ -633,7 +1004,13 @@ class DataMatrixRenderer extends SymbologyRenderer {
column < numOfColumns &&
!(array[row * numOfColumns + column] != 0)) {
_errorCorrectingCode200PlacementBlock(
- array, numOfRows, numOfColumns, row, column, place++);
+ array,
+ numOfRows,
+ numOfColumns,
+ row,
+ column,
+ place++,
+ );
}
row += 2;
@@ -710,8 +1087,10 @@ class DataMatrixRenderer extends SymbologyRenderer {
num++;
}
- final List result =
- List.filled((1 + num) + dataCodeword.length, null);
+ final List result = List.filled(
+ (1 + num) + dataCodeword.length,
+ null,
+ );
result[0] = 231;
if (dataCodeword.length <= 249) {
result[1] = dataCodeword.length;
@@ -755,13 +1134,16 @@ class DataMatrixRenderer extends SymbologyRenderer {
}
}
- final List result =
- List.filled(destinationArray.length ~/ 2, null);
+ final List result = List.filled(
+ destinationArray.length ~/ 2,
+ null,
+ );
for (int i = 0; i < result.length; i++) {
if (!isEven && i == result.length - 1) {
result[i] = destinationArray[2 * i]! + 1;
} else {
- result[i] = (((destinationArray[2 * i]! - 48) * 10) +
+ result[i] =
+ (((destinationArray[2 * i]! - 48) * 10) +
(destinationArray[(2 * i) + 1]! - 48)) +
130;
}
@@ -815,7 +1197,9 @@ class DataMatrixRenderer extends SymbologyRenderer {
final int numCorrectionCodeword = _symbolAttribute.correctionCodeWords!;
// Create error correction array.
final List correctionCodeWordArray = List.filled(
- numCorrectionCodeword + _symbolAttribute.dataCodeWords!, null);
+ numCorrectionCodeword + _symbolAttribute.dataCodeWords!,
+ null,
+ );
for (int i = 0; i < correctionCodeWordArray.length; i++) {
correctionCodeWordArray[i] = 0;
}
@@ -836,10 +1220,14 @@ class DataMatrixRenderer extends SymbologyRenderer {
for (int i = block; i < symbolDataWords; i += step) {
final int val = _getErrorCorrectingCodeSum(
- blockByte[blockErrorWords - 1]!, _encodedCodeword![i]!);
+ blockByte[blockErrorWords - 1]!,
+ _encodedCodeword![i]!,
+ );
for (int j = blockErrorWords - 1; j > 0; j--) {
- blockByte[j] = _getErrorCorrectingCodeSum(blockByte[j - 1]!,
- _getErrorCorrectingCodeProduct(_polynomial[j]!, val));
+ blockByte[j] = _getErrorCorrectingCodeSum(
+ blockByte[j - 1]!,
+ _getErrorCorrectingCodeProduct(_polynomial[j]!, val),
+ );
}
blockByte[0] = _getErrorCorrectingCodeProduct(_polynomial[0]!, val);
@@ -865,12 +1253,16 @@ class DataMatrixRenderer extends SymbologyRenderer {
}
return _getCorrectionCodeWordArray(
- correctionCodeWordArray, numCorrectionCodeword);
+ correctionCodeWordArray,
+ numCorrectionCodeword,
+ );
}
/// Method to get the correction code word
List _getCorrectionCodeWordArray(
- List correctionCodeWordArray, int numCorrectionCodeword) {
+ List correctionCodeWordArray,
+ int numCorrectionCodeword,
+ ) {
if (correctionCodeWordArray.length > numCorrectionCodeword) {
final List tmp = correctionCodeWordArray;
correctionCodeWordArray = List.filled(numCorrectionCodeword, null);
@@ -901,8 +1293,11 @@ class DataMatrixRenderer extends SymbologyRenderer {
}
}
} else {
- _symbolAttribute = _symbolAttributes[
- getDataMatrixSize(_dataMatrixSymbology.dataMatrixSize) - 1];
+ _symbolAttribute =
+ _symbolAttributes[getDataMatrixSize(
+ _dataMatrixSymbology.dataMatrixSize,
+ ) -
+ 1];
}
List temp;
@@ -918,7 +1313,8 @@ class DataMatrixRenderer extends SymbologyRenderer {
final String symbolRow = _symbolAttribute.symbolRow.toString();
final String symbolColumn = _symbolAttribute.symbolColumn.toString();
throw ArgumentError(
- 'Data too long for $symbolRow x $symbolColumn barcode.');
+ 'Data too long for $symbolRow x $symbolColumn barcode.',
+ );
}
}
@@ -936,8 +1332,10 @@ class DataMatrixRenderer extends SymbologyRenderer {
for (int j = i - 1; j >= 0; j--) {
_polynomial[j] = _getErrorCorrectingCodeDoublify(_polynomial[j]!, i);
if (j > 0) {
- _polynomial[j] =
- _getErrorCorrectingCodeSum(_polynomial[j]!, _polynomial[j - 1]!);
+ _polynomial[j] = _getErrorCorrectingCodeSum(
+ _polynomial[j]!,
+ _polynomial[j - 1]!,
+ );
}
}
}
@@ -946,10 +1344,13 @@ class DataMatrixRenderer extends SymbologyRenderer {
/// Method to get the code word
List _getCodeword(List dataCodeword) {
_encodedCodeword = _getDataCodeword(dataCodeword);
- final List correctCodeword =
- _getComputedErrorCorrection(_encodedCodeword!);
+ final List correctCodeword = _getComputedErrorCorrection(
+ _encodedCodeword!,
+ );
final List finalCodeword = List.filled(
- _encodedCodeword!.length + correctCodeword.length, null);
+ _encodedCodeword!.length + correctCodeword.length,
+ null,
+ );
for (int i = 0; i < _encodedCodeword!.length; i++) {
finalCodeword[i] = _encodedCodeword![i];
}
@@ -994,7 +1395,8 @@ class DataMatrixRenderer extends SymbologyRenderer {
if (actualEncoding == DataMatrixEncoding.asciiNumeric &&
_dataMatrixSymbology.encoding != actualEncoding) {
throw ArgumentError(
- 'Data contains invalid characters and cannot be encoded as ASCIINumeric.');
+ 'Data contains invalid characters and cannot be encoded as ASCIINumeric.',
+ );
}
_encoding = actualEncoding;
@@ -1030,15 +1432,16 @@ class DataMatrixRenderer extends SymbologyRenderer {
@override
void renderBarcode(
- Canvas canvas,
- Size size,
- Offset offset,
- String value,
- Color foregroundColor,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- bool showValue) {
+ Canvas canvas,
+ Size size,
+ Offset offset,
+ String value,
+ Color foregroundColor,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ bool showValue,
+ ) {
_inputValue = value;
_buildDataMatrix();
@@ -1053,7 +1456,8 @@ class DataMatrixRenderer extends SymbologyRenderer {
getDataMatrixSize(_dataMatrixSymbology.dataMatrixSize) < 25;
int dimension = minSize ~/ _dataMatrixList.length;
final int rectDimension = minSize ~/ _dataMatrixList[0].length;
- final int xDimension = _dataMatrixSymbology.module ??
+ final int xDimension =
+ _dataMatrixSymbology.module ??
(isSquareMatrix ? dimension : rectDimension);
dimension = _dataMatrixSymbology.module ?? dimension;
for (int i = 0; i < w; i++) {
@@ -1073,7 +1477,11 @@ class DataMatrixRenderer extends SymbologyRenderer {
for (int j = 0; j < h; j++) {
if (_dataMatrixList[i][j] == 1) {
final Rect matrixRect = Rect.fromLTRB(
- x, yPosition, x + xDimension, yPosition + dimension);
+ x,
+ yPosition,
+ x + xDimension,
+ yPosition + dimension,
+ );
canvas.drawRect(matrixRect, paint);
}
@@ -1086,23 +1494,39 @@ class DataMatrixRenderer extends SymbologyRenderer {
if (showValue) {
final Offset textOffset = Offset(offset.dx, yPosition.toDouble());
drawText(
- canvas, textOffset, size, value, textStyle, textSpacing, textAlign);
+ canvas,
+ textOffset,
+ size,
+ value,
+ textStyle,
+ textSpacing,
+ textAlign,
+ );
}
}
/// Method to render the input value of the barcode
@override
- void drawText(Canvas canvas, Offset offset, Size size, String value,
- TextStyle textStyle, double textSpacing, TextAlign textAlign,
- [Offset? actualOffset, Size? actualSize]) {
+ void drawText(
+ Canvas canvas,
+ Offset offset,
+ Size size,
+ String value,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign, [
+ Offset? actualOffset,
+ Size? actualSize,
+ ]) {
final TextSpan span = TextSpan(text: value, style: textStyle);
final TextPainter textPainter = TextPainter(
- maxLines: 1,
- ellipsis: '.....',
- text: span,
- textDirection: TextDirection.ltr,
- textAlign: textAlign);
+ maxLines: 1,
+ ellipsis: '.....',
+ text: span,
+ textDirection: TextDirection.ltr,
+ textAlign: textAlign,
+ );
textPainter.layout(maxWidth: size.width);
double x;
double y;
@@ -1141,15 +1565,16 @@ class DataMatrixRenderer extends SymbologyRenderer {
/// Represents the data matrix symbol attribute
class _DataMatrixSymbolAttribute {
/// Creates the data matrix symbol attribute
- _DataMatrixSymbolAttribute(
- {this.symbolRow,
- this.symbolColumn,
- this.horizontalDataRegion,
- this.verticalDataRegion,
- this.dataCodeWords,
- this.correctionCodeWords,
- this.interLeavedBlock,
- this.interLeavedDataBlock});
+ _DataMatrixSymbolAttribute({
+ this.symbolRow,
+ this.symbolColumn,
+ this.horizontalDataRegion,
+ this.verticalDataRegion,
+ this.dataCodeWords,
+ this.correctionCodeWords,
+ this.interLeavedBlock,
+ this.interLeavedDataBlock,
+ });
/// Defines the symbol row
final int? symbolRow;
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/error_correction_codewords.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/error_correction_codewords.dart
index c3297ba16..ccb2da71c 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/error_correction_codewords.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/error_correction_codewords.dart
@@ -6,7 +6,9 @@ class ErrorCorrectionCodeWords {
/// Creates the error correction code word
ErrorCorrectionCodeWords({this.codeVersion, this.correctionLevel}) {
_codeValue = QRCodeValue(
- qrCodeVersion: codeVersion!, errorCorrectionLevel: correctionLevel!);
+ qrCodeVersion: codeVersion!,
+ errorCorrectionLevel: correctionLevel!,
+ );
eccw = _codeValue.noOfErrorCorrectionCodeWord;
}
@@ -272,7 +274,7 @@ class ErrorCorrectionCodeWords {
216,
173,
71,
- 142
+ 142,
];
/// Specifies the error corrcetion code word
@@ -325,7 +327,7 @@ class ErrorCorrectionCodeWords {
218,
206,
140,
- 78
+ 78,
];
break;
case 15:
@@ -345,7 +347,7 @@ class ErrorCorrectionCodeWords {
124,
5,
99,
- 105
+ 105,
];
break;
case 16:
@@ -366,7 +368,7 @@ class ErrorCorrectionCodeWords {
182,
194,
225,
- 120
+ 120,
];
break;
case 17:
@@ -388,7 +390,7 @@ class ErrorCorrectionCodeWords {
39,
243,
163,
- 136
+ 136,
];
break;
case 18:
@@ -411,7 +413,7 @@ class ErrorCorrectionCodeWords {
5,
98,
96,
- 153
+ 153,
];
break;
case 20:
@@ -436,7 +438,7 @@ class ErrorCorrectionCodeWords {
212,
212,
188,
- 190
+ 190,
];
break;
case 22:
@@ -463,7 +465,7 @@ class ErrorCorrectionCodeWords {
160,
105,
165,
- 231
+ 231,
];
break;
case 24:
@@ -492,7 +494,7 @@ class ErrorCorrectionCodeWords {
87,
96,
227,
- 21
+ 21,
];
break;
case 26:
@@ -523,7 +525,7 @@ class ErrorCorrectionCodeWords {
153,
145,
218,
- 70
+ 70,
];
break;
case 28:
@@ -556,7 +558,7 @@ class ErrorCorrectionCodeWords {
242,
37,
9,
- 123
+ 123,
];
break;
case 30:
@@ -591,7 +593,7 @@ class ErrorCorrectionCodeWords {
238,
40,
192,
- 180
+ 180,
];
break;
case 32:
@@ -628,7 +630,7 @@ class ErrorCorrectionCodeWords {
254,
185,
220,
- 241
+ 241,
];
break;
case 34:
@@ -667,7 +669,7 @@ class ErrorCorrectionCodeWords {
98,
62,
129,
- 51
+ 51,
];
break;
case 36:
@@ -708,7 +710,7 @@ class ErrorCorrectionCodeWords {
113,
233,
30,
- 120
+ 120,
];
break;
case 40:
@@ -753,7 +755,7 @@ class ErrorCorrectionCodeWords {
232,
53,
35,
- 15
+ 15,
];
break;
case 42:
@@ -800,7 +802,7 @@ class ErrorCorrectionCodeWords {
194,
117,
50,
- 96
+ 96,
];
break;
case 44:
@@ -849,7 +851,7 @@ class ErrorCorrectionCodeWords {
113,
102,
73,
- 181
+ 181,
];
break;
case 46:
@@ -900,7 +902,7 @@ class ErrorCorrectionCodeWords {
223,
19,
82,
- 15
+ 15,
];
break;
case 48:
@@ -953,7 +955,7 @@ class ErrorCorrectionCodeWords {
163,
39,
34,
- 108
+ 108,
];
break;
case 50:
@@ -1008,7 +1010,7 @@ class ErrorCorrectionCodeWords {
215,
232,
133,
- 205
+ 205,
];
break;
case 52:
@@ -1065,7 +1067,7 @@ class ErrorCorrectionCodeWords {
239,
254,
116,
- 51
+ 51,
];
break;
case 54:
@@ -1124,7 +1126,7 @@ class ErrorCorrectionCodeWords {
198,
76,
31,
- 156
+ 156,
];
break;
case 56:
@@ -1185,7 +1187,7 @@ class ErrorCorrectionCodeWords {
207,
20,
61,
- 10
+ 10,
];
break;
case 58:
@@ -1248,7 +1250,7 @@ class ErrorCorrectionCodeWords {
233,
125,
148,
- 123
+ 123,
];
break;
case 60:
@@ -1313,7 +1315,7 @@ class ErrorCorrectionCodeWords {
89,
7,
33,
- 240
+ 240,
];
break;
case 62:
@@ -1380,7 +1382,7 @@ class ErrorCorrectionCodeWords {
36,
186,
110,
- 106
+ 106,
];
break;
case 64:
@@ -1449,7 +1451,7 @@ class ErrorCorrectionCodeWords {
217,
156,
213,
- 231
+ 231,
];
break;
case 66:
@@ -1520,7 +1522,7 @@ class ErrorCorrectionCodeWords {
132,
93,
45,
- 105
+ 105,
];
break;
case 68:
@@ -1593,7 +1595,7 @@ class ErrorCorrectionCodeWords {
5,
8,
163,
- 238
+ 238,
];
break;
}
@@ -1641,14 +1643,17 @@ class ErrorCorrectionCodeWords {
Map generatorPolynom = {};
for (int i = 0; i < _gx.length; i++) {
- generatorPolynom[_gx.length - 1 - i] =
- _getElementFromAlpha(_gx[i], _alpha);
+ generatorPolynom[_gx.length - 1 - i] = _getElementFromAlpha(
+ _gx[i],
+ _alpha,
+ );
}
Map tempMessagePolynom = {};
for (int i = 0; i < messagePolynom.length; i++) {
- final MapEntry currentEntry =
- messagePolynom.entries.elementAt(i);
+ final MapEntry currentEntry = messagePolynom.entries.elementAt(
+ i,
+ );
tempMessagePolynom[currentEntry.key + eccw] = currentEntry.value;
}
@@ -1657,8 +1662,8 @@ class ErrorCorrectionCodeWords {
tempMessagePolynom = {};
for (int i = 0; i < generatorPolynom.length; i++) {
- final MapEntry currentEntry =
- generatorPolynom.entries.elementAt(i);
+ final MapEntry currentEntry = generatorPolynom.entries
+ .elementAt(i);
tempMessagePolynom[currentEntry.key + leadTermFactor] =
currentEntry.value;
}
@@ -1670,12 +1675,18 @@ class ErrorCorrectionCodeWords {
if (leadTermSource[largestExponent] == 0) {
leadTermSource.remove(largestExponent);
if (i == 0) {
- leadTermSource =
- _updateLeadTermSource(i, leadTermSource, generatorPolynom);
+ leadTermSource = _updateLeadTermSource(
+ i,
+ leadTermSource,
+ generatorPolynom,
+ );
}
} else {
- leadTermSource =
- _updateLeadTermSource(i, leadTermSource, generatorPolynom);
+ leadTermSource = _updateLeadTermSource(
+ i,
+ leadTermSource,
+ generatorPolynom,
+ );
}
}
@@ -1691,10 +1702,16 @@ class ErrorCorrectionCodeWords {
/// Updates the lead term source value
Map _updateLeadTermSource(
- int index, Map leadTermSource, Map generatorPolynom) {
+ int index,
+ Map leadTermSource,
+ Map generatorPolynom,
+ ) {
final Map alphaNotation = _getAlphaNotation(leadTermSource);
- Map resPoly = _getGeneratorPolynomByLeadTerm(generatorPolynom,
- alphaNotation[_getLargestExponent(alphaNotation)]!, index);
+ Map resPoly = _getGeneratorPolynomByLeadTerm(
+ generatorPolynom,
+ alphaNotation[_getLargestExponent(alphaNotation)]!,
+ index,
+ );
resPoly = _getDecimalNotation(resPoly);
resPoly = _getXORPolynoms(leadTermSource, resPoly);
return resPoly;
@@ -1702,7 +1719,9 @@ class ErrorCorrectionCodeWords {
/// Calculates the polynomial value
Map _getXORPolynoms(
- Map messagePolynom, Map resPolynom) {
+ Map messagePolynom,
+ Map resPolynom,
+ ) {
final Map resultPolynom = {};
Map longPoly = {};
Map shortPoly = {};
@@ -1720,10 +1739,11 @@ class ErrorCorrectionCodeWords {
for (int i = 0; i < longPoly.length; i++) {
resultPolynom.putIfAbsent(
- messagePolyExponent - i,
- () =>
- longPoly.entries.elementAt(i).value ^
- (shortPoly.length > i ? shortPoly[shortPolyExponent - i]! : 0));
+ messagePolyExponent - i,
+ () =>
+ longPoly.entries.elementAt(i).value ^
+ (shortPoly.length > i ? shortPoly[shortPolyExponent - i]! : 0),
+ );
}
final int resultPolyExponent = _getLargestExponent(resultPolynom);
@@ -1733,12 +1753,17 @@ class ErrorCorrectionCodeWords {
/// Calculates the polynomial value
Map _getGeneratorPolynomByLeadTerm(
- Map genPolynom, int leadTermCoefficient, int lowerExponentBy) {
+ Map genPolynom,
+ int leadTermCoefficient,
+ int lowerExponentBy,
+ ) {
final Map tempPolynom = {};
for (int i = 0; i < genPolynom.length; i++) {
final MapEntry currentEntry = genPolynom.entries.elementAt(i);
- tempPolynom.putIfAbsent(currentEntry.key - lowerExponentBy,
- () => (currentEntry.value + leadTermCoefficient) % 255);
+ tempPolynom.putIfAbsent(
+ currentEntry.key - lowerExponentBy,
+ () => (currentEntry.value + leadTermCoefficient) % 255,
+ );
}
return tempPolynom;
@@ -1749,8 +1774,10 @@ class ErrorCorrectionCodeWords {
final Map tempPolynom = {};
for (int i = 0; i < poly.length; i++) {
final MapEntry currentEntry = poly.entries.elementAt(i);
- tempPolynom[currentEntry.key] =
- _getIntValFromAlphaExp(currentEntry.value, _alpha);
+ tempPolynom[currentEntry.key] = _getIntValFromAlphaExp(
+ currentEntry.value,
+ _alpha,
+ );
}
return tempPolynom;
@@ -1762,8 +1789,10 @@ class ErrorCorrectionCodeWords {
for (int i = 0; i < polynom.length; i++) {
final MapEntry currentEntry = polynom.entries.elementAt(i);
if (currentEntry.value != 0) {
- tempPolynom.putIfAbsent(currentEntry.key,
- () => _getElementFromAlpha(currentEntry.value, _alpha));
+ tempPolynom.putIfAbsent(
+ currentEntry.key,
+ () => _getElementFromAlpha(currentEntry.value, _alpha),
+ );
}
}
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/qr_code_renderer.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/qr_code_renderer.dart
index 729fe6c68..0ce548cd0 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/qr_code_renderer.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/qr_code_renderer.dart
@@ -91,7 +91,7 @@ class QRCodeRenderer extends SymbologyRenderer {
'258C',
'2590',
'2580',
- '25A0'
+ '25A0',
];
/// Specifies the latin2 character set
@@ -152,7 +152,7 @@ class QRCodeRenderer extends SymbologyRenderer {
'16F',
'171',
'163',
- '2D9'
+ '2D9',
];
/// Specifies the latin3 character set
@@ -182,7 +182,7 @@ class QRCodeRenderer extends SymbologyRenderer {
'121',
'11D',
'16D',
- '15D'
+ '15D',
];
/// Specifies the latin4 character set
@@ -235,7 +235,7 @@ class QRCodeRenderer extends SymbologyRenderer {
'137',
'173',
'169',
- '16B'
+ '16B',
];
/// Specifies the windows 1250 character set
@@ -249,7 +249,7 @@ class QRCodeRenderer extends SymbologyRenderer {
'15F',
'13D',
'13E',
- '17C'
+ '17C',
];
/// Specifies the windows 1251 character set
@@ -283,7 +283,7 @@ class QRCodeRenderer extends SymbologyRenderer {
'458',
'405',
'455',
- '457'
+ '457',
];
/// Specifies the windows 1252 character set
@@ -314,7 +314,7 @@ class QRCodeRenderer extends SymbologyRenderer {
'203A',
'153',
'17E',
- '178'
+ '178',
];
/// Specifies the QR code value
@@ -516,7 +516,7 @@ class QRCodeRenderer extends SymbologyRenderer {
'153',
'6BA',
'6BE',
- '6C1'
+ '6C1',
];
if (windows1256CharSet.contains(inputChar)) {
@@ -717,9 +717,10 @@ class QRCodeRenderer extends SymbologyRenderer {
///Methods to creates the block value based on the encoded data
List> _getBlocks(List encodeData, int noOfBlocks) {
final List> encodedBlocks = List>.generate(
- noOfBlocks,
- (int i) =>
- List.filled(encodeData.length ~/ 8 ~/ noOfBlocks, null));
+ noOfBlocks,
+ (int i) =>
+ List.filled(encodeData.length ~/ 8 ~/ noOfBlocks, null),
+ );
String stringValue = '';
int j = 0;
@@ -746,7 +747,10 @@ class QRCodeRenderer extends SymbologyRenderer {
/// Method to the split code word
List _splitCodeWord(
- List> encodeData, int block, int count) {
+ List> encodeData,
+ int block,
+ int count,
+ ) {
final List encodeDataString = List.filled(count, null);
for (int i = 0; i < count; i++) {
encodeDataString[i] = encodeData[block][i];
@@ -820,7 +824,6 @@ class QRCodeRenderer extends SymbologyRenderer {
_eciAssignmentNumber = 2;
break;
}
-
//Check for ISO/IEC 8859-2
else if (_getIsISO8859_2CharacterSet(_encodedText[i].codeUnitAt(0))) {
_eciAssignmentNumber = 4;
@@ -861,7 +864,6 @@ class QRCodeRenderer extends SymbologyRenderer {
_eciAssignmentNumber = 13;
break;
}
-
//Check for Windows1250
else if (_getIsWindows1250Character(_encodedText[i].codeUnitAt(0))) {
_eciAssignmentNumber = 21;
@@ -938,17 +940,24 @@ class QRCodeRenderer extends SymbologyRenderer {
int capacity = 0;
if (_inputMode == QRInputMode.alphaNumeric) {
capacity = QRCodeValue.getAlphaNumericDataCapacity(
- _errorCorrectionLevel, _codeVersion);
+ _errorCorrectionLevel,
+ _codeVersion,
+ );
} else if (_inputMode == QRInputMode.numeric) {
capacity = QRCodeValue.getNumericDataCapacity(
- _errorCorrectionLevel, _codeVersion);
+ _errorCorrectionLevel,
+ _codeVersion,
+ );
} else if (_inputMode == QRInputMode.binary) {
capacity = QRCodeValue.getBinaryDataCapacity(
- _errorCorrectionLevel, _codeVersion);
+ _errorCorrectionLevel,
+ _codeVersion,
+ );
}
if (capacity < _encodedText.length) {
throw ArgumentError(
- 'The input value length is greater than version capacity');
+ 'The input value length is greater than version capacity',
+ );
}
} else {
int capacityLow = 0,
@@ -957,31 +966,55 @@ class QRCodeRenderer extends SymbologyRenderer {
capacityHigh = 0;
if (_inputMode == QRInputMode.alphaNumeric) {
capacityLow = QRCodeValue.getAlphaNumericDataCapacity(
- ErrorCorrectionLevel.low, _codeVersion);
+ ErrorCorrectionLevel.low,
+ _codeVersion,
+ );
capacityMedium = QRCodeValue.getAlphaNumericDataCapacity(
- ErrorCorrectionLevel.medium, _codeVersion);
+ ErrorCorrectionLevel.medium,
+ _codeVersion,
+ );
capacityQuartile = QRCodeValue.getAlphaNumericDataCapacity(
- ErrorCorrectionLevel.quartile, _codeVersion);
+ ErrorCorrectionLevel.quartile,
+ _codeVersion,
+ );
capacityHigh = QRCodeValue.getAlphaNumericDataCapacity(
- ErrorCorrectionLevel.high, _codeVersion);
+ ErrorCorrectionLevel.high,
+ _codeVersion,
+ );
} else if (_inputMode == QRInputMode.numeric) {
capacityLow = QRCodeValue.getNumericDataCapacity(
- ErrorCorrectionLevel.low, _codeVersion);
+ ErrorCorrectionLevel.low,
+ _codeVersion,
+ );
capacityMedium = QRCodeValue.getNumericDataCapacity(
- ErrorCorrectionLevel.medium, _codeVersion);
+ ErrorCorrectionLevel.medium,
+ _codeVersion,
+ );
capacityQuartile = QRCodeValue.getNumericDataCapacity(
- ErrorCorrectionLevel.quartile, _codeVersion);
+ ErrorCorrectionLevel.quartile,
+ _codeVersion,
+ );
capacityHigh = QRCodeValue.getNumericDataCapacity(
- ErrorCorrectionLevel.high, _codeVersion);
+ ErrorCorrectionLevel.high,
+ _codeVersion,
+ );
} else if (_inputMode == QRInputMode.binary) {
capacityLow = QRCodeValue.getBinaryDataCapacity(
- ErrorCorrectionLevel.low, _codeVersion);
+ ErrorCorrectionLevel.low,
+ _codeVersion,
+ );
capacityMedium = QRCodeValue.getBinaryDataCapacity(
- ErrorCorrectionLevel.medium, _codeVersion);
+ ErrorCorrectionLevel.medium,
+ _codeVersion,
+ );
capacityQuartile = QRCodeValue.getBinaryDataCapacity(
- ErrorCorrectionLevel.quartile, _codeVersion);
+ ErrorCorrectionLevel.quartile,
+ _codeVersion,
+ );
capacityHigh = QRCodeValue.getBinaryDataCapacity(
- ErrorCorrectionLevel.high, _codeVersion);
+ ErrorCorrectionLevel.high,
+ _codeVersion,
+ );
}
if (capacityHigh > _encodedText.length) {
@@ -994,7 +1027,8 @@ class QRCodeRenderer extends SymbologyRenderer {
_errorCorrectionLevel = ErrorCorrectionLevel.low;
} else {
throw ArgumentError(
- 'The input value length is greater than version capacity');
+ 'The input value length is greater than version capacity',
+ );
}
}
}
@@ -1130,9 +1164,10 @@ class QRCodeRenderer extends SymbologyRenderer {
/// uses single for loop for calculating the data allocation values
void _dataAllocationAndMasking(List data) {
_dataAllocationValues = List>.generate(
- _noOfModules,
- (int i) =>
- List.generate(_noOfModules, (int j) => ModuleValue()));
+ _noOfModules,
+ (int i) =>
+ List.generate(_noOfModules, (int j) => ModuleValue()),
+ );
int point = 0;
@@ -1421,12 +1456,14 @@ class QRCodeRenderer extends SymbologyRenderer {
void _generateValues() {
_initialize();
_qrCodeValues = QRCodeValue(
- qrCodeVersion: _codeVersion,
- errorCorrectionLevel: _errorCorrectionLevel);
+ qrCodeVersion: _codeVersion,
+ errorCorrectionLevel: _errorCorrectionLevel,
+ );
_moduleValues = List>.generate(
- _noOfModules,
- (int i) =>
- List.generate(_noOfModules, (int j) => ModuleValue()));
+ _noOfModules,
+ (int i) =>
+ List.generate(_noOfModules, (int j) => ModuleValue()),
+ );
_drawPDP(0, 0);
_drawPDP(_noOfModules - 7, 0);
_drawPDP(0, _noOfModules - 7);
@@ -1475,8 +1512,10 @@ class QRCodeRenderer extends SymbologyRenderer {
_encodeDataCodeWords.add(true);
//Add ECI assignment number
- final List numberInBool =
- _getStringToBoolArray(_eciAssignmentNumber.toString(), 8);
+ final List numberInBool = _getStringToBoolArray(
+ _eciAssignmentNumber.toString(),
+ 8,
+ );
for (int i = 0; i < numberInBool.length; i++) {
_encodeDataCodeWords.add(numberInBool[i]!);
}
@@ -1629,7 +1668,8 @@ class QRCodeRenderer extends SymbologyRenderer {
/// European Encoding
} else {
throw ArgumentError(
- 'The provided input value contains non-convertible characters');
+ 'The provided input value contains non-convertible characters',
+ );
}
final List numberInBool = _getIntToBoolArray(number, 8);
@@ -1695,8 +1735,10 @@ class QRCodeRenderer extends SymbologyRenderer {
if (_blocks!.length == 6) {
totalBlockSize = _blocks![0] + _blocks![3];
}
- final List> ds1 =
- List>.generate(totalBlockSize, (int i) => []);
+ final List> ds1 = List>.generate(
+ totalBlockSize,
+ (int i) => [],
+ );
List testEncodeData = _encodeDataCodeWords;
if (_blocks!.length == 6) {
@@ -1708,33 +1750,45 @@ class QRCodeRenderer extends SymbologyRenderer {
}
List> dsOne = List>.generate(
- _blocks![0],
- (int i) => List.filled(
- testEncodeData.length ~/ 8 ~/ _blocks![0], null));
+ _blocks![0],
+ (int i) =>
+ List.filled(testEncodeData.length ~/ 8 ~/ _blocks![0], null),
+ );
dsOne = _getBlocks(testEncodeData, _blocks![0]);
for (int i = 0; i < _blocks![0]; i++) {
- ds1[i] =
- _splitCodeWord(dsOne, i, testEncodeData.length ~/ 8 ~/ _blocks![0]);
+ ds1[i] = _splitCodeWord(
+ dsOne,
+ i,
+ testEncodeData.length ~/ 8 ~/ _blocks![0],
+ );
}
if (_blocks!.length == 6) {
testEncodeData = [];
- for (int i = _blocks![0] * _blocks![2] * 8;
- i < _encodeDataCodeWords.length;
- i++) {
+ for (
+ int i = _blocks![0] * _blocks![2] * 8;
+ i < _encodeDataCodeWords.length;
+ i++
+ ) {
testEncodeData.add(_encodeDataCodeWords[i]);
}
List> dsTwo = List>.generate(
- _blocks![0],
- (int i) => List.filled(
- testEncodeData.length ~/ 8 ~/ _blocks![3], null));
+ _blocks![0],
+ (int i) => List.filled(
+ testEncodeData.length ~/ 8 ~/ _blocks![3],
+ null,
+ ),
+ );
dsTwo = _getBlocks(testEncodeData, _blocks![3]);
for (int i = _blocks![0], count = 0; i < totalBlockSize; i++) {
ds1[i] = _splitCodeWord(
- dsTwo, count++, testEncodeData.length ~/ 8 ~/ _blocks![3]);
+ dsTwo,
+ count++,
+ testEncodeData.length ~/ 8 ~/ _blocks![3],
+ );
}
}
@@ -1771,7 +1825,9 @@ class QRCodeRenderer extends SymbologyRenderer {
final List numberOfBitsInCharacterCountIndicatorInBool =
_getIntToBoolArray(
- _encodedText.length, numberOfBitsInCharacterCountIndicator);
+ _encodedText.length,
+ numberOfBitsInCharacterCountIndicator,
+ );
for (int i = 0; i < numberOfBitsInCharacterCountIndicator; i++) {
_encodeDataCodeWords.add(numberOfBitsInCharacterCountIndicatorInBool[i]!);
@@ -1795,10 +1851,14 @@ class QRCodeRenderer extends SymbologyRenderer {
/// Method to calculate the error correcting code word
void _calculateErrorCorrectingCodeWord(
- int totalBlockSize, List> ds1) {
+ int totalBlockSize,
+ List> ds1,
+ ) {
final ErrorCorrectionCodeWords errorCorrectionCodeWord =
ErrorCorrectionCodeWords(
- codeVersion: _codeVersion, correctionLevel: _errorCorrectionLevel);
+ codeVersion: _codeVersion,
+ correctionLevel: _errorCorrectionLevel,
+ );
_dataBits = _qrCodeValues.noOfDataCodeWord;
final int eccw = _qrCodeValues.noOfErrorCorrectionCodeWord;
@@ -1813,8 +1873,10 @@ class QRCodeRenderer extends SymbologyRenderer {
errorCorrectionCodeWord.eccw = eccw ~/ totalBlockSize;
- final List> polynomial =
- List>.generate(totalBlockSize, (int i) => []);
+ final List> polynomial = List>.generate(
+ totalBlockSize,
+ (int i) => [],
+ );
int count = 0;
for (int i = 0; i < _blocks![0]; i++) {
@@ -1856,15 +1918,16 @@ class QRCodeRenderer extends SymbologyRenderer {
@override
void renderBarcode(
- Canvas canvas,
- Size size,
- Offset offset,
- String value,
- Color foregroundColor,
- TextStyle textStyle,
- double textSpacing,
- TextAlign textAlign,
- bool showValue) {
+ Canvas canvas,
+ Size size,
+ Offset offset,
+ String value,
+ Color foregroundColor,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign,
+ bool showValue,
+ ) {
_encodedText = value;
_generateValues();
@@ -1899,8 +1962,12 @@ class QRCodeRenderer extends SymbologyRenderer {
}
}
- final Rect rect = Rect.fromLTRB(x.toDouble(), yPosition.toDouble(),
- (x + dimension).toDouble(), (yPosition + dimension).toDouble());
+ final Rect rect = Rect.fromLTRB(
+ x.toDouble(),
+ yPosition.toDouble(),
+ (x + dimension).toDouble(),
+ (yPosition + dimension).toDouble(),
+ );
canvas.drawRect(rect, paint);
x = (x + dimension).toInt();
@@ -1912,23 +1979,39 @@ class QRCodeRenderer extends SymbologyRenderer {
if (showValue) {
final Offset textOffset = Offset(offset.dx, yPosition.toDouble());
drawText(
- canvas, textOffset, size, value, textStyle, textSpacing, textAlign);
+ canvas,
+ textOffset,
+ size,
+ value,
+ textStyle,
+ textSpacing,
+ textAlign,
+ );
}
}
/// Method to render the input value of the barcode
@override
- void drawText(Canvas canvas, Offset offset, Size size, String value,
- TextStyle textStyle, double textSpacing, TextAlign textAlign,
- [Offset? actualOffset, Size? actualSize]) {
+ void drawText(
+ Canvas canvas,
+ Offset offset,
+ Size size,
+ String value,
+ TextStyle textStyle,
+ double textSpacing,
+ TextAlign textAlign, [
+ Offset? actualOffset,
+ Size? actualSize,
+ ]) {
final TextSpan span = TextSpan(text: value, style: textStyle);
final TextPainter textPainter = TextPainter(
- maxLines: 1,
- ellipsis: '.....',
- text: span,
- textDirection: TextDirection.ltr,
- textAlign: textAlign);
+ maxLines: 1,
+ ellipsis: '.....',
+ text: span,
+ textDirection: TextDirection.ltr,
+ textAlign: textAlign,
+ );
textPainter.layout(maxWidth: size.width);
double x;
double y;
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/qr_code_values.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/qr_code_values.dart
index d88600794..3f948a99b 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/qr_code_values.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/qr_code_values.dart
@@ -200,7 +200,7 @@ class QRCodeValue {
750,
1372,
2040,
- 2430
+ 2430,
];
/// Specifies the value of numeric data capacity of low error correction level
@@ -379,7 +379,7 @@ class QRCodeValue {
2625,
2735,
2927,
- 3057
+ 3057,
];
/// Specifies the value of alpha numeric data capacity of low error
@@ -424,7 +424,7 @@ class QRCodeValue {
3729,
3927,
4087,
- 4296
+ 4296,
];
/// Specifies the value of alpha numeric data capacity of high error
@@ -469,7 +469,7 @@ class QRCodeValue {
2894,
3054,
3220,
- 3391
+ 3391,
];
/// Specifies the value of alpha numeric data capacity of quartile error
@@ -514,7 +514,7 @@ class QRCodeValue {
2071,
2181,
2298,
- 2420
+ 2420,
];
/// Specifies the value of alpha numeric data capacity of high error
@@ -559,7 +559,7 @@ class QRCodeValue {
1591,
1658,
1774,
- 1852
+ 1852,
];
/// Specifies the value of binary data capacity of low error correction level
@@ -603,7 +603,7 @@ class QRCodeValue {
2563,
2699,
2809,
- 2953
+ 2953,
];
/// Specifies the value of binary data capacity of medium error correction
@@ -648,7 +648,7 @@ class QRCodeValue {
1989,
2099,
2213,
- 2331
+ 2331,
];
/// Specifies the value of binary data capacity of quartile error correction
@@ -693,7 +693,7 @@ class QRCodeValue {
1423,
1499,
1579,
- 1663
+ 1663,
];
/// Specifies the value of binary data capacity of high error correction level
@@ -737,12 +737,14 @@ class QRCodeValue {
1093,
1139,
1219,
- 1273
+ 1273,
];
/// Returns the numeric data capacity
static int getNumericDataCapacity(
- ErrorCorrectionLevel level, QRCodeVersion codeVersion) {
+ ErrorCorrectionLevel level,
+ QRCodeVersion codeVersion,
+ ) {
List capacity;
switch (level) {
case ErrorCorrectionLevel.low:
@@ -765,7 +767,9 @@ class QRCodeValue {
/// Specifies the alpha numeric data capcity
static int getAlphaNumericDataCapacity(
- ErrorCorrectionLevel level, QRCodeVersion codeVersion) {
+ ErrorCorrectionLevel level,
+ QRCodeVersion codeVersion,
+ ) {
List capacity;
switch (level) {
case ErrorCorrectionLevel.low:
@@ -789,7 +793,9 @@ class QRCodeValue {
/// Specifies the bunary data capacity
static int getBinaryDataCapacity(
- ErrorCorrectionLevel level, QRCodeVersion codeVersion) {
+ ErrorCorrectionLevel level,
+ QRCodeVersion codeVersion,
+ ) {
List capacity;
switch (level) {
case ErrorCorrectionLevel.low:
@@ -3080,7 +3086,7 @@ class QRCodeValue {
1,
0,
0,
- 0
+ 0,
];
break;
case 8:
@@ -3102,7 +3108,7 @@ class QRCodeValue {
0,
1,
0,
- 0
+ 0,
];
break;
case 9:
@@ -3124,7 +3130,7 @@ class QRCodeValue {
0,
1,
0,
- 0
+ 0,
];
break;
case 10:
@@ -3146,7 +3152,7 @@ class QRCodeValue {
0,
1,
0,
- 0
+ 0,
];
break;
case 11:
@@ -3168,7 +3174,7 @@ class QRCodeValue {
0,
1,
0,
- 0
+ 0,
];
break;
case 12:
@@ -3190,7 +3196,7 @@ class QRCodeValue {
1,
1,
0,
- 0
+ 0,
];
break;
case 13:
@@ -3212,7 +3218,7 @@ class QRCodeValue {
1,
1,
0,
- 0
+ 0,
];
break;
case 14:
@@ -3234,7 +3240,7 @@ class QRCodeValue {
1,
1,
0,
- 0
+ 0,
];
break;
case 15:
@@ -3256,7 +3262,7 @@ class QRCodeValue {
1,
1,
0,
- 0
+ 0,
];
break;
case 16:
@@ -3278,7 +3284,7 @@ class QRCodeValue {
0,
0,
1,
- 0
+ 0,
];
break;
case 17:
@@ -3300,7 +3306,7 @@ class QRCodeValue {
0,
0,
1,
- 0
+ 0,
];
break;
case 18:
@@ -3322,7 +3328,7 @@ class QRCodeValue {
0,
0,
1,
- 0
+ 0,
];
break;
case 19:
@@ -3344,7 +3350,7 @@ class QRCodeValue {
0,
0,
1,
- 0
+ 0,
];
break;
case 20:
@@ -3366,7 +3372,7 @@ class QRCodeValue {
1,
0,
1,
- 0
+ 0,
];
break;
case 21:
@@ -3388,7 +3394,7 @@ class QRCodeValue {
1,
0,
1,
- 0
+ 0,
];
break;
case 22:
@@ -3410,7 +3416,7 @@ class QRCodeValue {
1,
0,
1,
- 0
+ 0,
];
break;
case 23:
@@ -3432,7 +3438,7 @@ class QRCodeValue {
1,
0,
1,
- 0
+ 0,
];
break;
case 24:
@@ -3454,7 +3460,7 @@ class QRCodeValue {
0,
1,
1,
- 0
+ 0,
];
break;
case 25:
@@ -3476,7 +3482,7 @@ class QRCodeValue {
0,
1,
1,
- 0
+ 0,
];
break;
case 26:
@@ -3498,7 +3504,7 @@ class QRCodeValue {
0,
1,
1,
- 0
+ 0,
];
break;
case 27:
@@ -3520,7 +3526,7 @@ class QRCodeValue {
0,
1,
1,
- 0
+ 0,
];
break;
case 28:
@@ -3542,7 +3548,7 @@ class QRCodeValue {
1,
1,
1,
- 0
+ 0,
];
break;
case 29:
@@ -3564,7 +3570,7 @@ class QRCodeValue {
1,
1,
1,
- 0
+ 0,
];
break;
case 30:
@@ -3586,7 +3592,7 @@ class QRCodeValue {
1,
1,
1,
- 0
+ 0,
];
break;
case 31:
@@ -3608,7 +3614,7 @@ class QRCodeValue {
1,
1,
1,
- 0
+ 0,
];
break;
case 32:
@@ -3630,7 +3636,7 @@ class QRCodeValue {
0,
0,
0,
- 1
+ 1,
];
break;
case 33:
@@ -3652,7 +3658,7 @@ class QRCodeValue {
0,
0,
0,
- 1
+ 1,
];
break;
case 34:
@@ -3674,7 +3680,7 @@ class QRCodeValue {
0,
0,
0,
- 1
+ 1,
];
break;
case 35:
@@ -3696,7 +3702,7 @@ class QRCodeValue {
0,
0,
0,
- 1
+ 1,
];
break;
case 36:
@@ -3718,7 +3724,7 @@ class QRCodeValue {
1,
0,
0,
- 1
+ 1,
];
break;
case 37:
@@ -3740,7 +3746,7 @@ class QRCodeValue {
1,
0,
0,
- 1
+ 1,
];
break;
case 38:
@@ -3762,7 +3768,7 @@ class QRCodeValue {
1,
0,
0,
- 1
+ 1,
];
break;
case 39:
@@ -3784,7 +3790,7 @@ class QRCodeValue {
1,
0,
0,
- 1
+ 1,
];
break;
case 40:
@@ -3806,7 +3812,7 @@ class QRCodeValue {
0,
1,
0,
- 1
+ 1,
];
break;
}
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/two_dimensional/datamatrix_symbology.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/two_dimensional/datamatrix_symbology.dart
index ffa636fef..bfbf02525 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/two_dimensional/datamatrix_symbology.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/two_dimensional/datamatrix_symbology.dart
@@ -16,11 +16,11 @@ class DataMatrix extends Symbology {
///
/// The arguments [module] must be non-negative and greater than 0.
///
- DataMatrix(
- {int? module,
- this.dataMatrixSize = DataMatrixSize.auto,
- this.encoding = DataMatrixEncoding.auto})
- : super(module: module);
+ DataMatrix({
+ int? module,
+ this.dataMatrixSize = DataMatrixSize.auto,
+ this.encoding = DataMatrixEncoding.auto,
+ }) : super(module: module);
/// Define the size that is used to encode the amount of data.
///
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/two_dimensional/qr_code_symbology.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/two_dimensional/qr_code_symbology.dart
index 66a97945a..7bb95df42 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/two_dimensional/qr_code_symbology.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/two_dimensional/qr_code_symbology.dart
@@ -30,12 +30,12 @@ class QRCode extends Symbology {
///
/// The arguments [module] must be non-negative and greater than 0.
///
- QRCode(
- {this.codeVersion,
- this.errorCorrectionLevel = ErrorCorrectionLevel.high,
- this.inputMode = QRInputMode.binary,
- int? module})
- : super(module: module);
+ QRCode({
+ this.codeVersion,
+ this.errorCorrectionLevel = ErrorCorrectionLevel.high,
+ this.inputMode = QRInputMode.binary,
+ int? module,
+ }) : super(module: module);
/// Define the version that is used to encode the amount of data.
///
diff --git a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/utils/enum.dart b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/utils/enum.dart
index 3fd6a47c9..3f1a8988e 100644
--- a/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/utils/enum.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/utils/enum.dart
@@ -10,7 +10,7 @@ enum CodeType {
doubleDigit,
///CodeType.fnc1 represents the input symbol is special character.
- fnc1
+ fnc1,
}
/// Versions that is used to encode the amount of data.
@@ -136,7 +136,7 @@ enum QRCodeVersion {
version39,
///QRCodeVersion.version40 specifies the qr code version is 40.
- version40
+ version40,
}
/// Encode recovery capacity of the barcode.
@@ -152,7 +152,7 @@ enum ErrorCorrectionLevel {
quartile,
///ErrorCorrectionLevel.high is recover approximately 30% of the codewords.
- high
+ high,
}
/// Specific set of input mode characters.
@@ -164,7 +164,7 @@ enum QRInputMode {
alphaNumeric,
///QRInputMode.binary represents the input data as binary.
- binary
+ binary,
}
/// Encoding type for the [DataMatrix] code.
@@ -179,7 +179,7 @@ enum DataMatrixEncoding {
asciiNumeric,
/// DataMatrixEncoding.base256 represents the base256 encoding.
- base256
+ base256,
}
/// Sizes that is used to encode the amount of [DataMatrix] data.
@@ -275,5 +275,5 @@ enum DataMatrixSize {
size16x36,
/// DataMatrixSize.size16x48 represents the 16x48 matrix.
- size16x48
+ size16x48,
}
diff --git a/packages/syncfusion_flutter_barcodes/pubspec.yaml b/packages/syncfusion_flutter_barcodes/pubspec.yaml
index d54bd6693..aa8e7860e 100644
--- a/packages/syncfusion_flutter_barcodes/pubspec.yaml
+++ b/packages/syncfusion_flutter_barcodes/pubspec.yaml
@@ -1,6 +1,6 @@
name: syncfusion_flutter_barcodes
description: Flutter Barcodes generator library is used to generate and display data in the machine-readable, industry-standard 1D and 2D barcodes.
-version: 29.1.33
+version: 30.1.37
homepage: https://github.com/syncfusion/flutter-widgets/tree/master/packages/syncfusion_flutter_barcodes
screenshots:
@@ -12,13 +12,13 @@ screenshots:
environment:
- sdk: '>=3.4.0 <4.0.0'
+ sdk: ^3.7.0
dependencies:
flutter:
sdk: flutter
syncfusion_flutter_core:
- path: ../syncfusion_flutter_core
+ path: ../syncfusion_flutter_core
diff --git a/packages/syncfusion_flutter_calendar/CHANGELOG.md b/packages/syncfusion_flutter_calendar/CHANGELOG.md
index a96556a8f..6a0ed1d4f 100644
--- a/packages/syncfusion_flutter_calendar/CHANGELOG.md
+++ b/packages/syncfusion_flutter_calendar/CHANGELOG.md
@@ -2,6 +2,36 @@
**General**
+* Upgraded the `timezone` package to the latest version 0.10.1.
+
+* The compatible version of our Flutter calendar widget has been updated to Flutter SDK 3.32.0.
+
+## [29.1.39] - 22/04/2025
+
+**General**
+
+* The minimum Dart version has been updated to 3.7.
+
+**Bugs**
+
+* \#FB66714 - Now, the font size is no longer calculated with a negative value in [SfCalendar](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/SfCalendar-class.html) when placed in a constrained space.
+
+* \#FB66695 - Now, the [headerDateFormat](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/SfCalendar/headerDateFormat.html) is applied correctly in the resource view of [SfCalendar](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/SfCalendar-class.html), displaying the date in the expected format.
+
+* \#FB66695 - Now, the week number in the resource view of [SfCalendar](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/SfCalendar-class.html), is fully visible and no longer gets cut off when sufficient space is available.
+
+* \#FB66690 - Now, the calendar cell overlay position updates correctly in the month view when the [timeRulerSize](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/TimeSlotViewSettings/timeRulerSize.html) is added in the [timeSlotViewSettings](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/SfCalendar/timeSlotViewSettings.html) of SfCalendar.
+
+## [29.1.37] - 08/04/2025
+
+**Bugs**
+
+* \#FB66610 - Now, the interactive widgets will work on the [appointmentBuilder](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/SfCalendar/appointmentBuilder.html) in SfCalendar.
+
+## [29.1.33] - 25/03/2025
+
+**General**
+
* The compatible version of our Flutter calendar widget has been updated to Flutter SDK 3.29.0.
* The Syncfusion® Flutter calendar example sample have been updated to support [kotlin build scripts](https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply) in Android platform.
* The Syncfusion® Flutter calendar example sample have been updated to support [Swift package manager](https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-app-developers) in macOS and iOS platforms.
diff --git a/packages/syncfusion_flutter_calendar/assets/fonts/Roboto-Medium.ttf b/packages/syncfusion_flutter_calendar/assets/fonts/Roboto-Medium.ttf
new file mode 100644
index 000000000..d629e9848
Binary files /dev/null and b/packages/syncfusion_flutter_calendar/assets/fonts/Roboto-Medium.ttf differ
diff --git a/packages/syncfusion_flutter_calendar/assets/images/May.png b/packages/syncfusion_flutter_calendar/assets/images/May.png
new file mode 100644
index 000000000..568ef2af5
Binary files /dev/null and b/packages/syncfusion_flutter_calendar/assets/images/May.png differ
diff --git a/packages/syncfusion_flutter_calendar/assets/images/People_Circle11.png b/packages/syncfusion_flutter_calendar/assets/images/People_Circle11.png
new file mode 100644
index 000000000..657adc38f
Binary files /dev/null and b/packages/syncfusion_flutter_calendar/assets/images/People_Circle11.png differ
diff --git a/packages/syncfusion_flutter_calendar/assets/images/People_Circle13.png b/packages/syncfusion_flutter_calendar/assets/images/People_Circle13.png
new file mode 100644
index 000000000..0f7a0da09
Binary files /dev/null and b/packages/syncfusion_flutter_calendar/assets/images/People_Circle13.png differ
diff --git a/packages/syncfusion_flutter_calendar/assets/images/People_Circle15.png b/packages/syncfusion_flutter_calendar/assets/images/People_Circle15.png
new file mode 100644
index 000000000..b8c08e671
Binary files /dev/null and b/packages/syncfusion_flutter_calendar/assets/images/People_Circle15.png differ
diff --git a/packages/syncfusion_flutter_calendar/assets/images/People_Circle18.png b/packages/syncfusion_flutter_calendar/assets/images/People_Circle18.png
new file mode 100644
index 000000000..4f31688b0
Binary files /dev/null and b/packages/syncfusion_flutter_calendar/assets/images/People_Circle18.png differ
diff --git a/packages/syncfusion_flutter_calendar/assets/images/People_Circle20.png b/packages/syncfusion_flutter_calendar/assets/images/People_Circle20.png
new file mode 100644
index 000000000..6a13793d2
Binary files /dev/null and b/packages/syncfusion_flutter_calendar/assets/images/People_Circle20.png differ
diff --git a/packages/syncfusion_flutter_calendar/assets/images/People_Circle23.png b/packages/syncfusion_flutter_calendar/assets/images/People_Circle23.png
new file mode 100644
index 000000000..d7a12ee96
Binary files /dev/null and b/packages/syncfusion_flutter_calendar/assets/images/People_Circle23.png differ
diff --git a/packages/syncfusion_flutter_calendar/assets/images/People_Circle24.png b/packages/syncfusion_flutter_calendar/assets/images/People_Circle24.png
new file mode 100644
index 000000000..d59cc5781
Binary files /dev/null and b/packages/syncfusion_flutter_calendar/assets/images/People_Circle24.png differ
diff --git a/packages/syncfusion_flutter_calendar/assets/images/People_Circle25.png b/packages/syncfusion_flutter_calendar/assets/images/People_Circle25.png
new file mode 100644
index 000000000..e047277d6
Binary files /dev/null and b/packages/syncfusion_flutter_calendar/assets/images/People_Circle25.png differ
diff --git a/packages/syncfusion_flutter_calendar/assets/images/People_Circle26.png b/packages/syncfusion_flutter_calendar/assets/images/People_Circle26.png
new file mode 100644
index 000000000..f88ab438e
Binary files /dev/null and b/packages/syncfusion_flutter_calendar/assets/images/People_Circle26.png differ
diff --git a/packages/syncfusion_flutter_calendar/assets/images/People_Circle27.png b/packages/syncfusion_flutter_calendar/assets/images/People_Circle27.png
new file mode 100644
index 000000000..4359bd60b
Binary files /dev/null and b/packages/syncfusion_flutter_calendar/assets/images/People_Circle27.png differ
diff --git a/packages/syncfusion_flutter_calendar/assets/images/People_Circle5.png b/packages/syncfusion_flutter_calendar/assets/images/People_Circle5.png
new file mode 100644
index 000000000..9a1f4b34a
Binary files /dev/null and b/packages/syncfusion_flutter_calendar/assets/images/People_Circle5.png differ
diff --git a/packages/syncfusion_flutter_calendar/assets/images/People_Circle8.png b/packages/syncfusion_flutter_calendar/assets/images/People_Circle8.png
new file mode 100644
index 000000000..f4fd0f82c
Binary files /dev/null and b/packages/syncfusion_flutter_calendar/assets/images/People_Circle8.png differ
diff --git a/packages/syncfusion_flutter_calendar/example/lib/main.dart b/packages/syncfusion_flutter_calendar/example/lib/main.dart
index 0bf68386a..f7eef85b8 100644
--- a/packages/syncfusion_flutter_calendar/example/lib/main.dart
+++ b/packages/syncfusion_flutter_calendar/example/lib/main.dart
@@ -29,15 +29,17 @@ class _MyHomePageState extends State {
@override
Widget build(BuildContext context) {
return Scaffold(
- body: SfCalendar(
- view: CalendarView.month,
- dataSource: MeetingDataSource(_getDataSource()),
- // by default the month appointment display mode set as Indicator, we can
- // change the display mode as appointment using the appointment display
- // mode property
- monthViewSettings: const MonthViewSettings(
- appointmentDisplayMode: MonthAppointmentDisplayMode.appointment),
- ));
+ body: SfCalendar(
+ view: CalendarView.month,
+ dataSource: MeetingDataSource(_getDataSource()),
+ // by default the month appointment display mode set as Indicator, we can
+ // change the display mode as appointment using the appointment display
+ // mode property
+ monthViewSettings: const MonthViewSettings(
+ appointmentDisplayMode: MonthAppointmentDisplayMode.appointment,
+ ),
+ ),
+ );
}
List _getDataSource() {
@@ -45,8 +47,9 @@ class _MyHomePageState extends State {
final DateTime today = DateTime.now();
final DateTime startTime = DateTime(today.year, today.month, today.day, 9);
final DateTime endTime = startTime.add(const Duration(hours: 2));
- meetings.add(Meeting(
- 'Conference', startTime, endTime, const Color(0xFF0F8644), false));
+ meetings.add(
+ Meeting('Conference', startTime, endTime, const Color(0xFF0F8644), false),
+ );
return meetings;
}
}
diff --git a/packages/syncfusion_flutter_calendar/example/pubspec.yaml b/packages/syncfusion_flutter_calendar/example/pubspec.yaml
index 9f5cc4b3a..8b21f28ed 100644
--- a/packages/syncfusion_flutter_calendar/example/pubspec.yaml
+++ b/packages/syncfusion_flutter_calendar/example/pubspec.yaml
@@ -3,7 +3,7 @@ description: Syncfusion calendar example.
version: 1.0.0+1
environment:
- sdk: '>=3.3.0 <4.0.0'
+ sdk: ^3.7.0-0
dependencies:
flutter:
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/appointment.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/appointment.dart
index fdc7028eb..91ea50cd9 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/appointment.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/appointment.dart
@@ -85,10 +85,11 @@ class Appointment with Diagnosticable {
this.subject = '',
this.color = Colors.lightBlue,
this.recurrenceExceptionDates,
- }) : notes = notes != null && notes.contains('isOccurrenceAppointment')
- ? notes.replaceAll('isOccurrenceAppointment', '')
- : notes,
- _notes = notes {
+ }) : notes =
+ notes != null && notes.contains('isOccurrenceAppointment')
+ ? notes.replaceAll('isOccurrenceAppointment', '')
+ : notes,
+ _notes = notes {
recurrenceRule = recurrenceId != null ? null : recurrenceRule;
_appointmentType = _getAppointmentType();
id = id ?? hashCode;
@@ -1021,14 +1022,21 @@ class Appointment with Diagnosticable {
properties.add(ColorProperty('color', color));
properties.add(DiagnosticsProperty