Skip to content

Commit 286835a

Browse files
Merge pull request syncfusion#1401 from syncfusion/Move-volume-3-release-source-widgets-repo
Moved volume 3 release source to flutter widgets repository
2 parents 686d069 + 0a71c26 commit 286835a

File tree

244 files changed

+7353
-1923
lines changed

Some content is hidden

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

244 files changed

+7353
-1923
lines changed

packages/syncfusion_flutter_barcodes/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
## Unreleased
22

3+
**Bugs**
4+
5+
* #FB45676 - Now, the QR code generated for all kinds of the input values with 07 [codeVersion](https://pub.dev/documentation/syncfusion_flutter_barcodes/latest/barcodes/QRCode/codeVersion.html), medium [errorCorrectionLevel](https://pub.dev/documentation/syncfusion_flutter_barcodes/latest/barcodes/QRCode/errorCorrectionLevel.html), and alphaNumeric [inputMode](https://pub.dev/documentation/syncfusion_flutter_barcodes/latest/barcodes/QRCode/inputMode.html) will be scannable.
6+
7+
## [22.1.36] 06/28/2023
8+
9+
**Bugs**
10+
* #FB44237 - Now, the QR code generated for all kinds of input values with 07 [codeVersion](https://pub.dev/documentation/syncfusion_flutter_barcodes/latest/barcodes/QRCode/codeVersion.html) will be scannable.
11+
12+
## [21.1.37] - 03/29/2023
13+
314
**Bugs**
415
* #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.
516

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

Lines changed: 21 additions & 28 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(String encodedText) {
302+
List<String> getERCW() {
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(encodedText);
1603+
decimalRepresentation = _getPolynominalDivision();
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(String encodedText) {
1636+
List<int> _getPolynominalDivision() {
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,20 +1665,17 @@ class ErrorCorrectionCodeWords {
16651665

16661666
generatorPolynom = tempMessagePolynom;
16671667
Map<int, int> leadTermSource = messagePolynom;
1668-
final bool isLargeText = encodedText.length > 75;
16691668
for (int i = 0; i < messagePolynom.length; i++) {
1670-
final int largestExponent = isLargeText
1671-
? _getLargestExponentsKey(leadTermSource)
1672-
: _getLargestExponent(leadTermSource);
1669+
final int largestExponent = _getLargestExponent(leadTermSource);
16731670
if (leadTermSource[largestExponent] == 0) {
16741671
leadTermSource.remove(largestExponent);
1672+
if (i == 0) {
1673+
leadTermSource =
1674+
_updateLeadTermSource(i, leadTermSource, generatorPolynom);
1675+
}
16751676
} else {
1676-
final Map<int, int> alphaNotation = _getAlphaNotation(leadTermSource);
1677-
Map<int, int> resPoly = _getGeneratorPolynomByLeadTerm(generatorPolynom,
1678-
alphaNotation[_getLargestExponent(alphaNotation)]!, i);
1679-
resPoly = _getDecimalNotation(resPoly);
1680-
resPoly = _getXORPolynoms(leadTermSource, resPoly);
1681-
leadTermSource = resPoly;
1677+
leadTermSource =
1678+
_updateLeadTermSource(i, leadTermSource, generatorPolynom);
16821679
}
16831680
}
16841681

@@ -1692,6 +1689,17 @@ class ErrorCorrectionCodeWords {
16921689
return returnValue;
16931690
}
16941691

1692+
/// Updates the lead term source value
1693+
Map<int, int> _updateLeadTermSource(
1694+
int index, Map<int, int> leadTermSource, Map<int, int> generatorPolynom) {
1695+
final Map<int, int> alphaNotation = _getAlphaNotation(leadTermSource);
1696+
Map<int, int> resPoly = _getGeneratorPolynomByLeadTerm(generatorPolynom,
1697+
alphaNotation[_getLargestExponent(alphaNotation)]!, index);
1698+
resPoly = _getDecimalNotation(resPoly);
1699+
resPoly = _getXORPolynoms(leadTermSource, resPoly);
1700+
return resPoly;
1701+
}
1702+
16951703
/// Calculates the polynomial value
16961704
Map<int, int> _getXORPolynoms(
16971705
Map<int, int> messagePolynom, Map<int, int> resPolynom) {
@@ -1771,24 +1779,9 @@ class ErrorCorrectionCodeWords {
17711779
largeExponent = currentEntry.key;
17721780
}
17731781
}
1774-
17751782
return largeExponent;
17761783
}
17771784

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-
17921785
/// Returns the integer value
17931786
int _getIntValFromAlphaExp(int element, List<int> alpha) {
17941787
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(_encodedText);
1822+
polynomial[count++] = errorCorrectionCodeWord.getERCW();
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(_encodedText);
1830+
polynomial[count++] = errorCorrectionCodeWord.getERCW();
18311831
}
18321832
}
18331833

packages/syncfusion_flutter_barcodes/pubspec.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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: 22.1.34
3+
version: 23.1.36
44
homepage: https://github.com/syncfusion/flutter-widgets/tree/master/packages/syncfusion_flutter_barcodes
55

66
environment:
@@ -9,7 +9,8 @@ environment:
99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
syncfusion_flutter_core: ^22.1.34
12+
syncfusion_flutter_core: ^23.1.36
13+
1314

1415
dev_dependencies:
1516
flutter_test:

packages/syncfusion_flutter_calendar/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [22.2.5]
2+
**Features**
3+
* Provided support to accessibility for builders in the Flutter event calendar.
4+
15
## [20.3.56]
26
**Features**
37
* Provided text style customization support for the text in the placeholder (`No events` and `No selected date`) in the month agenda view and (`No events`) in the schedule view of the flutter event calendar.

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,30 @@ class AppointmentHelper {
214214
isSameOrBeforeDate(viewEndDate, appEndTime);
215215
}
216216

217+
/// Returns the specific date appointment collection by filtering the
218+
/// appointments from passed visible appointment collection.
219+
static List<CalendarAppointment> getSpecificDateVisibleAppointment(
220+
DateTime? date, List<CalendarAppointment>? visibleAppointments) {
221+
final List<CalendarAppointment> appointmentCollection =
222+
<CalendarAppointment>[];
223+
if (date == null || visibleAppointments == null) {
224+
return appointmentCollection;
225+
}
226+
227+
final DateTime startDate = convertToStartTime(date);
228+
final DateTime endDate = convertToEndTime(date);
229+
230+
for (int j = 0; j < visibleAppointments.length; j++) {
231+
final CalendarAppointment appointment = visibleAppointments[j];
232+
if (isAppointmentWithinVisibleDateRange(
233+
appointment, startDate, endDate)) {
234+
appointmentCollection.add(appointment);
235+
}
236+
}
237+
238+
return appointmentCollection;
239+
}
240+
217241
/// Return appointment collection based on the date.
218242
static List<CalendarAppointment> getSelectedDateAppointments(
219243
List<CalendarAppointment>? appointments,

packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_layout/agenda_view_layout.dart

Lines changed: 59 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,12 @@ class _AgendaViewRenderObject extends CustomCalendarRenderObject {
800800
List<CustomPainterSemantics> _getSemanticsBuilder(Size size) {
801801
final List<CustomPainterSemantics> semanticsBuilder =
802802
<CustomPainterSemantics>[];
803+
804+
final RenderBox? child = firstChild;
805+
if (child != null) {
806+
return semanticsBuilder;
807+
}
808+
803809
if (selectedDate == null) {
804810
semanticsBuilder.add(CustomPainterSemantics(
805811
rect: Offset.zero & size,
@@ -839,6 +845,18 @@ class _AgendaViewRenderObject extends CustomCalendarRenderObject {
839845
return semanticsBuilder;
840846
}
841847

848+
@override
849+
void visitChildrenForSemantics(RenderObjectVisitor visitor) {
850+
RenderBox? child = firstChild;
851+
if (child == null) {
852+
return;
853+
}
854+
while (child != null) {
855+
visitor(child);
856+
child = childAfter(child);
857+
}
858+
}
859+
842860
void _drawDefaultUI(Canvas canvas, bool isLargerScheduleUI, Offset offset) {
843861
_rectPainter.isAntiAlias = true;
844862
double yPosition = offset.dy + 5;
@@ -863,6 +881,15 @@ class _AgendaViewRenderObject extends CustomCalendarRenderObject {
863881
fontSize: 13)
864882
.merge(scheduleViewSettings!.appointmentTextStyle);
865883

884+
final List<String> appointmentStringFormats =
885+
appointmentTimeTextFormat == null
886+
? <String>[]
887+
: CalendarViewHelper.getListFromString(appointmentTimeTextFormat!);
888+
final List<String> sameDateAppointmentStringFormats =
889+
CalendarViewHelper.getListFromString('hh:mm a');
890+
final List<String> diffDateAppointmentStringFormats =
891+
CalendarViewHelper.getListFromString('MMM dd, hh:mm a');
892+
866893
//// Draw Appointments
867894
for (int i = 0; i < appointmentCollection.length; i++) {
868895
final AppointmentView appointmentView = appointmentCollection[i];
@@ -917,6 +944,8 @@ class _AgendaViewRenderObject extends CustomCalendarRenderObject {
917944
textSize,
918945
appointment,
919946
appointmentTextStyle,
947+
appointmentStringFormats,
948+
sameDateAppointmentStringFormats,
920949
offset);
921950
if (isSpanned) {
922951
final TextSpan icon = AppointmentHelper.getSpanIcon(
@@ -971,7 +1000,10 @@ class _AgendaViewRenderObject extends CustomCalendarRenderObject {
9711000
textSize,
9721001
appointment,
9731002
appointmentHeight,
974-
appointmentTextStyle);
1003+
appointmentTextStyle,
1004+
appointmentStringFormats,
1005+
sameDateAppointmentStringFormats,
1006+
diffDateAppointmentStringFormats);
9751007
} else {
9761008
//// Draw All day appointment
9771009
_updatePainterLinesCount(appointmentHeight, isAllDay: true);
@@ -1120,7 +1152,10 @@ class _AgendaViewRenderObject extends CustomCalendarRenderObject {
11201152
double recurrenceTextSize,
11211153
CalendarAppointment appointment,
11221154
double appointmentHeight,
1123-
TextStyle appointmentTextStyle) {
1155+
TextStyle appointmentTextStyle,
1156+
List<String> appointmentFormatString,
1157+
List<String> sameDateAppointmentFormatString,
1158+
List<String> diffDateAppointmentFormatString) {
11241159
_textPainter.textScaleFactor = textScaleFactor;
11251160
final double lineHeight = _updatePainterLinesCount(appointmentHeight);
11261161
final double iconSize = isRecurrence ? recurrenceTextSize + 10 : 0;
@@ -1136,15 +1171,17 @@ class _AgendaViewRenderObject extends CustomCalendarRenderObject {
11361171
_textPainter.paint(
11371172
canvas, Offset(xPosition + padding, yPosition + topPadding));
11381173

1139-
final String format = appointmentTimeTextFormat ??
1140-
(isSameDate(appointment.actualStartTime, appointment.actualEndTime)
1141-
? 'hh:mm a'
1142-
: 'MMM dd, hh:mm a');
1174+
final List<String> format = appointmentFormatString.isEmpty
1175+
? (isSameDate(appointment.actualStartTime, appointment.actualEndTime)
1176+
? sameDateAppointmentFormatString
1177+
: diffDateAppointmentFormatString)
1178+
: appointmentFormatString;
1179+
final String startDateText = CalendarViewHelper.getLocalizedString(
1180+
appointment.actualStartTime, format, locale);
1181+
final String endDateText = CalendarViewHelper.getLocalizedString(
1182+
appointment.actualEndTime, format, locale);
11431183
final TextSpan span = TextSpan(
1144-
text:
1145-
// ignore: lines_longer_than_80_chars
1146-
'${DateFormat(format, locale).format(appointment.actualStartTime)} - ${DateFormat(format, locale).format(appointment.actualEndTime)}',
1147-
style: appointmentTextStyle);
1184+
text: '$startDateText - $endDateText', style: appointmentTextStyle);
11481185
_textPainter.text = span;
11491186

11501187
_textPainter.maxLines = 1;
@@ -1232,7 +1269,8 @@ class _AgendaViewRenderObject extends CustomCalendarRenderObject {
12321269
void _updateTextPainterProperties(TextSpan span) {
12331270
_textPainter.text = span;
12341271
_textPainter.maxLines = 1;
1235-
_textPainter.textDirection = TextDirection.ltr;
1272+
_textPainter.textDirection =
1273+
CalendarViewHelper.getTextDirectionBasedOnLocale(locale);
12361274
_textPainter.textAlign = TextAlign.left;
12371275
_textPainter.textWidthBasis = TextWidthBasis.longestLine;
12381276
_textPainter.textScaleFactor = textScaleFactor;
@@ -1251,6 +1289,8 @@ class _AgendaViewRenderObject extends CustomCalendarRenderObject {
12511289
double textSize,
12521290
CalendarAppointment appointment,
12531291
TextStyle appointmentTextStyle,
1292+
List<String> appointmentFormatString,
1293+
List<String> sameDateAppointmentFormatString,
12541294
Offset offset) {
12551295
_textPainter.textScaleFactor = textScaleFactor;
12561296
final double centerYPosition = appointmentHeight / 2;
@@ -1287,13 +1327,17 @@ class _AgendaViewRenderObject extends CustomCalendarRenderObject {
12871327
final double topPadding = (appointmentHeight - _textPainter.height) / 2;
12881328
_textPainter.paint(
12891329
canvas, Offset(xPosition + padding, yPosition + topPadding));
1290-
final DateFormat format =
1291-
DateFormat(appointmentTimeTextFormat ?? 'hh:mm a', locale);
1330+
final List<String> format = appointmentFormatString.isEmpty
1331+
? sameDateAppointmentFormatString
1332+
: appointmentFormatString;
1333+
final String startDateText = CalendarViewHelper.getLocalizedString(
1334+
appointment.actualStartTime, format, locale);
1335+
final String endDateText = CalendarViewHelper.getLocalizedString(
1336+
appointment.actualEndTime, format, locale);
12921337
final TextSpan span = TextSpan(
12931338
text: appointment.isAllDay || appointment.isSpanned
12941339
? _localizations.allDayLabel
1295-
// ignore: lines_longer_than_80_chars
1296-
: '${format.format(appointment.actualStartTime)} - ${format.format(appointment.actualEndTime)}',
1340+
: '$startDateText - $endDateText',
12971341
style: appointmentTextStyle);
12981342
_textPainter.text = span;
12991343

packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_layout/allday_appointment_layout.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,6 +1576,12 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
15761576
List<CustomPainterSemantics> _getSemanticsBuilder(Size size) {
15771577
final List<CustomPainterSemantics> semanticsBuilder =
15781578
<CustomPainterSemantics>[];
1579+
1580+
final RenderBox? child = firstChild;
1581+
if (child != null) {
1582+
return semanticsBuilder;
1583+
}
1584+
15791585
if (appointmentCollection.isEmpty) {
15801586
return semanticsBuilder;
15811587
}
@@ -1640,4 +1646,16 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
16401646

16411647
return semanticsBuilder;
16421648
}
1649+
1650+
@override
1651+
void visitChildrenForSemantics(RenderObjectVisitor visitor) {
1652+
RenderBox? child = firstChild;
1653+
if (child == null) {
1654+
return;
1655+
}
1656+
while (child != null) {
1657+
visitor(child);
1658+
child = childAfter(child);
1659+
}
1660+
}
16431661
}

0 commit comments

Comments
 (0)