Skip to content

Commit aa1c111

Browse files
Merge pull request #2233 from Mugunthan-Ramalingam/FLUT-931209-update-latest-source
Moved all the widgets latest source changes to flutter widgets
2 parents 08111da + 2ad6b65 commit aa1c111

File tree

86 files changed

+814
-512
lines changed

Some content is hidden

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

86 files changed

+814
-512
lines changed

packages/syncfusion_flutter_calendar/CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
## [28.1.29] - 12/12/2024
1+
## [28.1.36] - 12/24/2024
2+
3+
**General**
4+
5+
* The compatible version of our Flutter calendar widget has been updated to Flutter SDK 3.27.0.
6+
7+
## [28.1.33] - 12/12/2024
28

39
**General**
410

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ class _AgendaViewRenderObject extends CustomCalendarRenderObject {
13621362
rect.top < agendaViewNotifier.value!.hoveringOffset.dy &&
13631363
rect.bottom > agendaViewNotifier.value!.hoveringOffset.dy) {
13641364
if (isLargerScheduleUI) {
1365-
_rectPainter.color = Colors.grey.withOpacity(0.1);
1365+
_rectPainter.color = Colors.grey.withValues(alpha: 0.1);
13661366
const double viewPadding = 2;
13671367
canvas.drawRRect(
13681368
RRect.fromRectAndRadius(
@@ -1375,7 +1375,7 @@ class _AgendaViewRenderObject extends CustomCalendarRenderObject {
13751375
_rectPainter);
13761376
} else {
13771377
_rectPainter.color =
1378-
calendarTheme.selectionBorderColor!.withOpacity(0.4);
1378+
calendarTheme.selectionBorderColor!.withValues(alpha: 0.4);
13791379
_rectPainter.style = PaintingStyle.stroke;
13801380
_rectPainter.strokeWidth = 2;
13811381
if (childCount == 0) {

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

+12-10
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class AllDayAppointmentLayout extends StatefulWidget {
4848

4949
/// Holds the selection details and user to trigger repaint to draw the
5050
/// selection.
51-
final ValueNotifier<SelectionDetails?> repaintNotifier;
51+
final ValueNotifier<AllDayPanelSelectionDetails?> repaintNotifier;
5252

5353
/// Used to get the calendar state details.
5454
final UpdateCalendarState updateCalendarState;
@@ -449,7 +449,7 @@ class _AllDayAppointmentRenderWidget extends MultiChildRenderObjectWidget {
449449
final CalendarView view;
450450
final List<DateTime> visibleDates;
451451
final List<CalendarAppointment>? visibleAppointments;
452-
final ValueNotifier<SelectionDetails?> repaintNotifier;
452+
final ValueNotifier<AllDayPanelSelectionDetails?> repaintNotifier;
453453
final double timeLabelWidth;
454454
final double allDayPainterHeight;
455455
final bool isRTL;
@@ -766,11 +766,12 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
766766
_allDayHoverPosition.addListener(markNeedsPaint);
767767
}
768768

769-
ValueNotifier<SelectionDetails?> _selectionNotifier;
769+
ValueNotifier<AllDayPanelSelectionDetails?> _selectionNotifier;
770770

771-
ValueNotifier<SelectionDetails?> get selectionNotifier => _selectionNotifier;
771+
ValueNotifier<AllDayPanelSelectionDetails?> get selectionNotifier =>
772+
_selectionNotifier;
772773

773-
set selectionNotifier(ValueNotifier<SelectionDetails?> value) {
774+
set selectionNotifier(ValueNotifier<AllDayPanelSelectionDetails?> value) {
774775
if (_selectionNotifier == value) {
775776
return;
776777
}
@@ -1373,7 +1374,7 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
13731374
_cellWidth;
13741375
final double leftPosition =
13751376
(rowIndex * _cellWidth) + (isRTL ? 0 : timeLabelWidth);
1376-
_rectPainter.color = Colors.grey.withOpacity(0.1);
1377+
_rectPainter.color = Colors.grey.withValues(alpha: 0.1);
13771378
canvas.drawRect(
13781379
Rect.fromLTWH(leftPosition, 0, _cellWidth, size.height), _rectPainter);
13791380
}
@@ -1395,8 +1396,8 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
13951396
appointmentView.endIndex > index) {
13961397
selectionDecoration ??= BoxDecoration(
13971398
color: themeData.brightness == Brightness.light
1398-
? Colors.white.withOpacity(0.3)
1399-
: Colors.black.withOpacity(0.4),
1399+
? Colors.white.withValues(alpha: 0.3)
1400+
: Colors.black.withValues(alpha: 0.4),
14001401
border:
14011402
Border.all(color: calendarTheme.selectionBorderColor!, width: 2),
14021403
borderRadius: const BorderRadius.all(Radius.circular(2)),
@@ -1436,7 +1437,7 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
14361437
/// Used to pass the argument of create box painter and it is called when
14371438
/// decoration have asynchronous data like image.
14381439
void _updateSelectionDecorationPainter() {
1439-
selectionNotifier.value = SelectionDetails(
1440+
selectionNotifier.value = AllDayPanelSelectionDetails(
14401441
selectionNotifier.value!.appointmentView,
14411442
selectionNotifier.value!.selectedDate);
14421443
}
@@ -1467,7 +1468,8 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
14671468
rect.right > allDayHoverPosition.value!.dx &&
14681469
rect.top < allDayHoverPosition.value!.dy &&
14691470
rect.bottom > allDayHoverPosition.value!.dy) {
1470-
_rectPainter.color = calendarTheme.selectionBorderColor!.withOpacity(0.4);
1471+
_rectPainter.color =
1472+
calendarTheme.selectionBorderColor!.withValues(alpha: 0.4);
14711473
_rectPainter.strokeWidth = 2;
14721474
_rectPainter.style = PaintingStyle.stroke;
14731475
canvas.drawRRect(rect, _rectPainter);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -2151,7 +2151,7 @@ class _AppointmentRenderObject extends CustomCalendarRenderObject {
21512151
rect.top < hoverPosition.dy &&
21522152
rect.bottom > hoverPosition.dy) {
21532153
_appointmentPainter.color =
2154-
calendarTheme.selectionBorderColor!.withOpacity(0.4);
2154+
calendarTheme.selectionBorderColor!.withValues(alpha: 0.4);
21552155
_appointmentPainter.strokeWidth = 2;
21562156
_appointmentPainter.style = PaintingStyle.stroke;
21572157
canvas.drawRRect(rect, _appointmentPainter);

packages/syncfusion_flutter_calendar/lib/src/calendar/common/calendar_view_helper.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -1331,9 +1331,9 @@ class ScheduleViewHoveringDetails {
13311331
/// if all day panel appointment selected then [appointmentView] holds
13321332
/// appointment details, else [selectedDate] holds selected region date value.
13331333
@immutable
1334-
class SelectionDetails {
1334+
class AllDayPanelSelectionDetails {
13351335
/// Constructor to create the selection details.
1336-
const SelectionDetails(this.appointmentView, this.selectedDate);
1336+
const AllDayPanelSelectionDetails(this.appointmentView, this.selectedDate);
13371337

13381338
/// Holds the selected appointment view details.
13391339
final AppointmentView? appointmentView;

packages/syncfusion_flutter_calendar/lib/src/calendar/resource_view/resource_view.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ class _ResourceViewRenderObject extends CustomCalendarRenderObject {
449449
(themeData.brightness == Brightness.dark
450450
? Colors.white
451451
: Colors.black87)
452-
.withOpacity(0.04);
452+
.withValues(alpha: 0.04);
453453
_addHovering(context.canvas, size, yPosition, resourceHoveringColor);
454454
}
455455

@@ -480,7 +480,7 @@ class _ResourceViewRenderObject extends CustomCalendarRenderObject {
480480
final Color resourceHoveringColor = (themeData.brightness == Brightness.dark
481481
? Colors.white
482482
: Colors.black87)
483-
.withOpacity(0.04);
483+
.withValues(alpha: 0.04);
484484
final TextStyle displayNameTextStyle = calendarTheme.displayNameTextStyle!;
485485
_circlePainter.color = resourceCellBorderColor;
486486
_circlePainter.strokeWidth = 0.5;

packages/syncfusion_flutter_calendar/lib/src/calendar/sfcalendar.dart

+24-24
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ class SfCalendar extends StatefulWidget {
645645
/// startTime: date,
646646
/// endTime: date.add(Duration(hours: 2)),
647647
/// enablePointerInteraction: false,
648-
/// color: Colors.grey.withOpacity(0.2),
648+
/// color: Colors.grey.withValues(alpha:0.2),
649649
/// text: 'Break'));
650650
///
651651
/// return regions;
@@ -1922,7 +1922,7 @@ class SfCalendar extends StatefulWidget {
19221922
/// startTime: DateTime.now(),
19231923
/// endTime: DateTime.now().add(Duration(hours: 1)),
19241924
/// enablePointerInteraction: false,
1925-
/// color: Colors.grey.withOpacity(0.2),
1925+
/// color: Colors.grey.withValues(alpha:0.2),
19261926
/// text: 'Break'));
19271927
///
19281928
/// return regions;
@@ -3879,15 +3879,15 @@ class _SfCalendarState extends State<SfCalendar>
38793879
?.merge(widget.blackoutDatesTextStyle),
38803880
trailingDatesTextStyle: themeData.textTheme.bodyMedium!
38813881
.copyWith(
3882-
color: colorScheme.onSurface.withOpacity(0.54),
3882+
color: colorScheme.onSurface.withValues(alpha: 0.54),
38833883
fontSize: isMaterial3 ? 14 : 13,
38843884
)
38853885
.merge(calendarThemeData.trailingDatesTextStyle)
38863886
.merge(
38873887
widget.monthViewSettings.monthCellStyle.trailingDatesTextStyle),
38883888
leadingDatesTextStyle: themeData.textTheme.bodyMedium!
38893889
.copyWith(
3890-
color: colorScheme.onSurface.withOpacity(0.54),
3890+
color: colorScheme.onSurface.withValues(alpha: 0.54),
38913891
fontSize: isMaterial3 ? 14 : 13,
38923892
)
38933893
.merge(calendarThemeData.leadingDatesTextStyle)
@@ -3902,37 +3902,37 @@ class _SfCalendarState extends State<SfCalendar>
39023902
.merge(widget.todayTextStyle),
39033903
headerTextStyle: themeData.textTheme.bodyLarge!
39043904
.copyWith(
3905-
color: colorScheme.onSurface.withOpacity(0.87),
3905+
color: colorScheme.onSurface.withValues(alpha: 0.87),
39063906
fontSize: isMaterial3 ? 16 : 18,
39073907
fontWeight: FontWeight.w400,
39083908
)
39093909
.merge(calendarThemeData.headerTextStyle)
39103910
.merge(widget.headerStyle.textStyle),
39113911
activeDatesTextStyle: themeData.textTheme.bodyMedium!
39123912
.copyWith(
3913-
color: colorScheme.onSurface.withOpacity(0.87),
3913+
color: colorScheme.onSurface.withValues(alpha: 0.87),
39143914
fontSize: 13,
39153915
)
39163916
.merge(calendarThemeData.activeDatesTextStyle)
39173917
.merge(widget.monthViewSettings.monthCellStyle.textStyle),
39183918
timeTextStyle: themeData.textTheme.bodySmall!
39193919
.copyWith(
3920-
color: colorScheme.onSurface.withOpacity(0.54),
3920+
color: colorScheme.onSurface.withValues(alpha: 0.54),
39213921
fontSize: isMaterial3 ? 12 : 10,
39223922
fontWeight: FontWeight.w500,
39233923
)
39243924
.merge(calendarThemeData.timeTextStyle)
39253925
.merge(widget.timeSlotViewSettings.timeTextStyle),
39263926
viewHeaderDateTextStyle: themeData.textTheme.bodyMedium!
39273927
.copyWith(
3928-
color: colorScheme.onSurface.withOpacity(0.87),
3928+
color: colorScheme.onSurface.withValues(alpha: 0.87),
39293929
fontSize: isMaterial3 ? 14 : 15,
39303930
)
39313931
.merge(calendarThemeData.viewHeaderDateTextStyle)
39323932
.merge(widget.viewHeaderStyle.dateTextStyle),
39333933
viewHeaderDayTextStyle: themeData.textTheme.bodySmall!
39343934
.copyWith(
3935-
color: colorScheme.onSurface.withOpacity(0.87),
3935+
color: colorScheme.onSurface.withValues(alpha: 0.87),
39363936
fontSize: isMaterial3 ? 12 : 11,
39373937
)
39383938
.merge(calendarThemeData.viewHeaderDayTextStyle)
@@ -3947,7 +3947,7 @@ class _SfCalendarState extends State<SfCalendar>
39473947
.merge(widget.resourceViewSettings.displayNameTextStyle),
39483948
weekNumberTextStyle: themeData.textTheme.bodyMedium!
39493949
.copyWith(
3950-
color: colorScheme.onSurface.withOpacity(0.87),
3950+
color: colorScheme.onSurface.withValues(alpha: 0.87),
39513951
fontSize: isMaterial3 ? 14 : 13,
39523952
)
39533953
.merge(calendarThemeData.weekNumberTextStyle)
@@ -5803,7 +5803,7 @@ class _SfCalendarState extends State<SfCalendar>
58035803
final double dividerHeight = _useMobilePlatformUI ? 0 : 1;
58045804
Color dividerColor =
58055805
widget.cellBorderColor ?? _calendarTheme.cellBorderColor!;
5806-
dividerColor = dividerColor.withOpacity(dividerColor.opacity * 0.5);
5806+
dividerColor = dividerColor.withValues(alpha: dividerColor.a * 0.5);
58075807
int numberOfEvents = 0;
58085808

58095809
double appointmentHeight = 0;
@@ -9523,7 +9523,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
95239523
final Color headerBackgroundColor = widget.headerStyle.backgroundColor ??
95249524
widget.calendarTheme.headerBackgroundColor!;
95259525
final Color arrowColor =
9526-
headerTextColor.withOpacity(headerTextColor.opacity * 0.6);
9526+
headerTextColor.withValues(alpha: headerTextColor.a * 0.6);
95279527
Color prevArrowColor = arrowColor;
95289528
Color nextArrowColor = arrowColor;
95299529
final TextStyle style = TextStyle(color: arrowColor);
@@ -9761,7 +9761,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
97619761
widget.maxDate,
97629762
dates,
97639763
widget.nonWorkingDays)) {
9764-
nextArrowColor = nextArrowColor.withOpacity(nextArrowColor.opacity * 0.5);
9764+
nextArrowColor = nextArrowColor.withValues(alpha: nextArrowColor.a * 0.5);
97659765
}
97669766

97679767
if (!DateTimeHelper.canMoveToPreviousView(
@@ -9771,7 +9771,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
97719771
widget.maxDate,
97729772
dates,
97739773
widget.nonWorkingDays)) {
9774-
prevArrowColor = prevArrowColor.withOpacity(prevArrowColor.opacity * 0.5);
9774+
prevArrowColor = prevArrowColor.withValues(alpha: prevArrowColor.a * 0.5);
97759775
}
97769776

97779777
MainAxisAlignment getAlignmentFromTextAlign() {
@@ -9923,7 +9923,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
99239923
decoration: BoxDecoration(
99249924
color:
99259925
widget.showDatePickerButton && widget.isPickerShown
9926-
? Colors.grey.withOpacity(0.3)
9926+
? Colors.grey.withValues(alpha: 0.3)
99279927
: headerBackgroundColor,
99289928
),
99299929

@@ -10330,7 +10330,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
1033010330
padding: EdgeInsets.all(useMobilePlatformUI ? 2 : 4),
1033110331
child: Material(
1033210332
color: isHighlighted && (isNeedIcon || useMobilePlatformUI)
10333-
? Colors.grey.withOpacity(0.3)
10333+
? Colors.grey.withValues(alpha: 0.3)
1033410334
: headerBackgroundColor,
1033510335
child: InkWell(
1033610336
splashColor: calendarViewSplashColor,
@@ -10642,7 +10642,7 @@ class _ScheduleLabelPainter extends CustomPainter {
1064210642
final Rect rect = Rect.fromLTWH(
1064310643
0, padding, size.width - 2, size.height - (2 * padding));
1064410644
_backgroundPainter.color =
10645-
calendarTheme.selectionBorderColor!.withOpacity(0.4);
10645+
calendarTheme.selectionBorderColor!.withValues(alpha: 0.4);
1064610646
_backgroundPainter.style = PaintingStyle.stroke;
1064710647
_backgroundPainter.strokeWidth = 2;
1064810648
canvas.drawRect(rect, _backgroundPainter);
@@ -10654,7 +10654,7 @@ class _ScheduleLabelPainter extends CustomPainter {
1065410654
padding + viewPadding,
1065510655
size.width - (isRTL ? viewPadding : padding),
1065610656
size.height - (2 * (viewPadding + padding)));
10657-
_backgroundPainter.color = Colors.grey.withOpacity(0.1);
10657+
_backgroundPainter.color = Colors.grey.withValues(alpha: 0.1);
1065810658
canvas.drawRRect(
1065910659
RRect.fromRectAndRadius(rect, const Radius.circular(4)),
1066010660
_backgroundPainter);
@@ -11090,7 +11090,7 @@ class _CustomSplash extends InteractiveInkFeature {
1109011090
..addListener(controller.markNeedsPaint)
1109111091
..addStatusListener(_handleAlphaStatusChanged);
1109211092
_alpha = _alphaController!.drive(IntTween(
11093-
begin: color.alpha,
11093+
begin: (color.a * 255).toInt(),
1109411094
end: 0,
1109511095
));
1109611096

@@ -11260,7 +11260,7 @@ class _AgendaDateTimePainter extends CustomPainter {
1126011260
/// Holds the default agenda day text style from framework text theme.
1126111261
final TextStyle agendaDayThemeTextStyle =
1126211262
themeData.textTheme.bodySmall!.copyWith(
11263-
color: themeData.colorScheme.onSurface.withOpacity(0.54),
11263+
color: themeData.colorScheme.onSurface.withValues(alpha: 0.54),
1126411264
fontSize: 10,
1126511265
fontWeight: FontWeight.w500,
1126611266
);
@@ -11394,11 +11394,11 @@ class _AgendaDateTimePainter extends CustomPainter {
1139411394
yPosition + _textPainter.height >
1139511395
agendaDateNotifier.value!.hoveringOffset.dy) {
1139611396
_linePainter.color = isToday
11397-
? Colors.black.withOpacity(0.1)
11397+
? Colors.black.withValues(alpha: 0.1)
1139811398
: (themeData.brightness == Brightness.dark
1139911399
? Colors.white
1140011400
: Colors.black87)
11401-
.withOpacity(0.04);
11401+
.withValues(alpha: 0.04);
1140211402
_drawTodayCircle(canvas, xPosition, yPosition, padding);
1140311403
}
1140411404
}
@@ -11460,11 +11460,11 @@ class _AgendaDateTimePainter extends CustomPainter {
1146011460
(yPosition + _textPainter.height) >
1146111461
agendaDateNotifier.value!.hoveringOffset.dy) {
1146211462
_linePainter.color = isToday
11463-
? Colors.black.withOpacity(0.1)
11463+
? Colors.black.withValues(alpha: 0.1)
1146411464
: (themeData.brightness == Brightness.dark
1146511465
? Colors.white
1146611466
: Colors.black87)
11467-
.withOpacity(0.04);
11467+
.withValues(alpha: 0.04);
1146811468
_drawTodayCircle(canvas, dateTextStartPosition, yPosition, padding);
1146911469
}
1147011470
}

0 commit comments

Comments
 (0)