Skip to content

Commit f930471

Browse files
Moved volume 2 release source to master.
1 parent 73ff826 commit f930471

File tree

223 files changed

+6333
-2762
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+6333
-2762
lines changed

packages/syncfusion_flutter_barcodes/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Unreleased
2+
3+
**Bugs**
4+
* #FB41210 - Now, the QR code generated for the input string contains 17 continuous spaces with medium [errorCorrectionLevel](https://pub.dev/documentation/syncfusion_flutter_barcodes/latest/barcodes/QRCode/errorCorrectionLevel.html), and 07 [codeVersion](https://pub.dev/documentation/syncfusion_flutter_barcodes/latest/barcodes/QRCode/codeVersion.html) will be scannable.
5+
16
## [20.3.50] - 10/18/2022
27

38
**Bugs**

packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/base/barcode_generator.dart

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class SfBarcodeGenerator extends StatefulWidget {
9292
this.showValue = false,
9393
this.textSpacing = 2,
9494
this.textAlign = TextAlign.center,
95-
this.textStyle = const TextStyle()})
95+
this.textStyle})
9696
: symbology = symbology ?? Code128(),
9797
super(key: key);
9898

@@ -247,7 +247,7 @@ class SfBarcodeGenerator extends StatefulWidget {
247247
/// textStyle: TextStyle(fontSize: 16));
248248
///}
249249
/// ```dart
250-
final TextStyle textStyle;
250+
final TextStyle? textStyle;
251251

252252
@override
253253
State<StatefulWidget> createState() {
@@ -258,7 +258,7 @@ class SfBarcodeGenerator extends StatefulWidget {
258258
/// Represents the barcode generator state
259259
class _SfBarcodeGeneratorState extends State<SfBarcodeGenerator> {
260260
/// Specifies the theme data
261-
late SfBarcodeThemeData _barcodeTheme;
261+
late SfBarcodeThemeData _barcodeThemeData;
262262

263263
/// Specifies the text size
264264
Size? _textSize;
@@ -267,16 +267,31 @@ class _SfBarcodeGeneratorState extends State<SfBarcodeGenerator> {
267267

268268
@override
269269
void didChangeDependencies() {
270-
_barcodeTheme = SfBarcodeTheme.of(context);
270+
_barcodeThemeData =
271+
_updateThemeData(Theme.of(context), SfBarcodeTheme.of(context));
271272
super.didChangeDependencies();
272273
}
273274

275+
SfBarcodeThemeData _updateThemeData(
276+
ThemeData themeData, SfBarcodeThemeData barcodeThemeData) {
277+
barcodeThemeData = barcodeThemeData.copyWith(
278+
textStyle: themeData.textTheme.bodyMedium!
279+
.copyWith(color: barcodeThemeData.textColor)
280+
.merge(barcodeThemeData.textStyle)
281+
.merge(widget.textStyle));
282+
return barcodeThemeData;
283+
}
284+
274285
@override
275286
void didUpdateWidget(SfBarcodeGenerator oldWidget) {
287+
_barcodeThemeData =
288+
_updateThemeData(Theme.of(context), SfBarcodeTheme.of(context));
289+
276290
if (widget.showValue &&
277291
(oldWidget.value != widget.value ||
278292
oldWidget.textStyle != widget.textStyle)) {
279-
_textSize = measureText(widget.value.toString(), widget.textStyle);
293+
_textSize =
294+
measureText(widget.value.toString(), _barcodeThemeData.textStyle!);
280295
}
281296

282297
if (widget.symbology != oldWidget.symbology) {
@@ -327,26 +342,20 @@ class _SfBarcodeGeneratorState extends State<SfBarcodeGenerator> {
327342
@override
328343
Widget build(BuildContext context) {
329344
if (widget.showValue && _textSize == null) {
330-
_textSize = measureText(widget.value.toString(), widget.textStyle);
345+
_textSize =
346+
measureText(widget.value.toString(), _barcodeThemeData.textStyle!);
331347
}
332348
_symbologyRenderer.getIsValidateInput(widget.value!);
333349
_symbologyRenderer.textSize = _textSize;
334350
return Container(
335-
color: widget.backgroundColor ?? _barcodeTheme.backgroundColor,
351+
color: widget.backgroundColor ?? _barcodeThemeData.backgroundColor,
336352
child: SfBarcodeGeneratorRenderObjectWidget(
337353
value: widget.value!,
338354
symbology: widget.symbology,
339-
foregroundColor: widget.barColor ?? _barcodeTheme.barColor,
355+
foregroundColor: widget.barColor ?? _barcodeThemeData.barColor,
340356
showText: widget.showValue,
341357
textSpacing: widget.textSpacing,
342-
textStyle: TextStyle(
343-
backgroundColor: widget.textStyle.backgroundColor,
344-
color: widget.textStyle.color ?? _barcodeTheme.textColor,
345-
fontSize: widget.textStyle.fontSize,
346-
fontFamily: widget.textStyle.fontFamily,
347-
fontStyle: widget.textStyle.fontStyle,
348-
fontWeight: widget.textStyle.fontWeight,
349-
textBaseline: widget.textStyle.textBaseline),
358+
textStyle: _barcodeThemeData.textStyle!,
350359
symbologyRenderer: _symbologyRenderer,
351360
textSize: _textSize,
352361
textAlign: widget.textAlign),

packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/error_correction_codewords.dart

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ class ErrorCorrectionCodeWords {
299299
/// refactored to a smaller methods, but it degrades the performance.Since it
300300
/// uses single switch condition for calculating the error correction code
301301
/// word based on the provided version
302-
List<String> getERCW() {
302+
List<String> getERCW(String encodedText) {
303303
List<int> decimalRepresentation;
304304
List<String> errorCorrectionWord;
305305
_decimalValue = <int>[dataBits];
@@ -1600,7 +1600,7 @@ class ErrorCorrectionCodeWords {
16001600

16011601
_gx = _getElement(_gx, _alpha);
16021602
_binaryToDecimal(dataCodeWords);
1603-
decimalRepresentation = _getPolynominalDivision();
1603+
decimalRepresentation = _getPolynominalDivision(encodedText);
16041604
errorCorrectionWord = _convertDecimalToBinary(decimalRepresentation);
16051605
return errorCorrectionWord;
16061606
}
@@ -1633,7 +1633,7 @@ class ErrorCorrectionCodeWords {
16331633
}
16341634

16351635
/// Calculates the polynomial value
1636-
List<int> _getPolynominalDivision() {
1636+
List<int> _getPolynominalDivision(String encodedText) {
16371637
Map<int, int> messagePolynom = <int, int>{};
16381638
for (int i = 0; i < _decimalValue.length; i++) {
16391639
messagePolynom[_decimalValue.length - 1 - i] = _decimalValue[i];
@@ -1665,8 +1665,11 @@ class ErrorCorrectionCodeWords {
16651665

16661666
generatorPolynom = tempMessagePolynom;
16671667
Map<int, int> leadTermSource = messagePolynom;
1668+
final bool isLargeText = encodedText.length > 75;
16681669
for (int i = 0; i < messagePolynom.length; i++) {
1669-
final int largestExponent = _getLargestExponent(leadTermSource);
1670+
final int largestExponent = isLargeText
1671+
? _getLargestExponentsKey(leadTermSource)
1672+
: _getLargestExponent(leadTermSource);
16701673
if (leadTermSource[largestExponent] == 0) {
16711674
leadTermSource.remove(largestExponent);
16721675
} else {
@@ -1772,6 +1775,20 @@ class ErrorCorrectionCodeWords {
17721775
return largeExponent;
17731776
}
17741777

1778+
/// Finds the largest exponential numbers key.
1779+
int _getLargestExponentsKey(Map<int, int> polynom) {
1780+
int largeExponent = 0;
1781+
int key = 0;
1782+
for (int i = 0; i < polynom.length; i++) {
1783+
final MapEntry<int, int> currentEntry = polynom.entries.elementAt(i);
1784+
if (currentEntry.key > largeExponent) {
1785+
largeExponent = currentEntry.value;
1786+
key = polynom.keys.elementAt(i);
1787+
}
1788+
}
1789+
return key;
1790+
}
1791+
17751792
/// Returns the integer value
17761793
int _getIntValFromAlphaExp(int element, List<int> alpha) {
17771794
if (element > 255) {

packages/syncfusion_flutter_barcodes/lib/src/barcode_generator/renderers/two_dimensional/qr_code_renderer.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,15 +1819,15 @@ class QRCodeRenderer extends SymbologyRenderer {
18191819

18201820
for (int i = 0; i < _blocks![0]; i++) {
18211821
errorCorrectionCodeWord.dataCodeWords = ds1[count];
1822-
polynomial[count++] = errorCorrectionCodeWord.getERCW();
1822+
polynomial[count++] = errorCorrectionCodeWord.getERCW(_encodedText);
18231823
}
18241824
if (_blocks!.length == 6) {
18251825
errorCorrectionCodeWord.dataBits =
18261826
(_dataBits - _blocks![0] * _blocks![2]) ~/ _blocks![3];
18271827

18281828
for (int i = 0; i < _blocks![3]; i++) {
18291829
errorCorrectionCodeWord.dataCodeWords = ds1[count];
1830-
polynomial[count++] = errorCorrectionCodeWord.getERCW();
1830+
polynomial[count++] = errorCorrectionCodeWord.getERCW(_encodedText);
18311831
}
18321832
}
18331833

packages/syncfusion_flutter_barcodes/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: syncfusion_flutter_barcodes
22
description: Flutter Barcodes generator library is used to generate and display data in the machine-readable, industry-standard 1D and 2D barcodes.
3-
version: 21.1.35
3+
version: 22.1.34
44
homepage: https://github.com/syncfusion/flutter-widgets/tree/master/packages/syncfusion_flutter_barcodes
55

66
environment:
7-
sdk: ">=2.17.0 <3.0.0"
7+
sdk: ">=2.17.0 <4.0.0"
88

99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
syncfusion_flutter_core: ^21.1.35
12+
syncfusion_flutter_core: ^22.1.34
1313

1414
dev_dependencies:
1515
flutter_test:

packages/syncfusion_flutter_calendar/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ The Flutter Calendar widget has built-in configurable views such as day, week, w
105105

106106
![appearance_customization](https://cdn.syncfusion.com/content/images/FTControl/Flutter/Appearance+customization.png)
107107

108-
* **Localization and Gloablization** - Display the current date and time by following the globalized date and time formats, and localize all available static texts in calendar.
108+
* **Localization and Globalization** - Display the current date and time by following the globalized date and time formats, and localize all available static texts in calendar.
109109

110110
![localization](https://cdn.syncfusion.com/content/images/FTControl/Flutter/calendar/localization.png)
111111

packages/syncfusion_flutter_calendar/example/test/widget_test.dart

Lines changed: 0 additions & 29 deletions
This file was deleted.

packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/appointment_helper.dart

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,13 @@ class AppointmentHelper {
257257

258258
/// Return calendar appointment text style.
259259
static TextStyle getAppointmentTextStyle(
260-
TextStyle appointmentTextStyle, CalendarView view) {
260+
TextStyle appointmentTextStyle, CalendarView view, ThemeData themeData) {
261261
if (appointmentTextStyle.fontSize != -1) {
262-
return appointmentTextStyle;
262+
return themeData.textTheme.bodyMedium!.merge(appointmentTextStyle);
263263
}
264-
return TextStyle(
265-
color: appointmentTextStyle.color,
266-
fontSize: 12,
267-
fontWeight: appointmentTextStyle.fontWeight,
268-
fontFamily: appointmentTextStyle.fontFamily);
264+
265+
return themeData.textTheme.bodyMedium!
266+
.merge(appointmentTextStyle.copyWith(fontSize: 12));
269267
}
270268

271269
static CalendarAppointment _copy(CalendarAppointment appointment) {

packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/month_appointment_helper.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ class MonthAppointmentHelper {
249249
/// swap list index value.
250250
/// Eg., app1 start with Nov3 10AM and ends with Nov5 11AM and app2 starts
251251
/// with Nov3 9AM and ends with Nov4 11AM then swap the app1 before of app2.
252-
return (AppointmentHelper.getDifference(endTime2, startTime2)
253-
.inMinutes
254-
.abs())
252+
return AppointmentHelper.getDifference(endTime2, startTime2)
253+
.inMinutes
254+
.abs()
255255
.compareTo(AppointmentHelper.getDifference(endTime1, startTime1)
256256
.inMinutes
257257
.abs());

0 commit comments

Comments
 (0)