@@ -645,7 +645,7 @@ class SfCalendar extends StatefulWidget {
645
645
/// startTime: date,
646
646
/// endTime: date.add(Duration(hours: 2)),
647
647
/// enablePointerInteraction: false,
648
- /// color: Colors.grey.withOpacity( 0.2),
648
+ /// color: Colors.grey.withValues(alpha: 0.2),
649
649
/// text: 'Break'));
650
650
///
651
651
/// return regions;
@@ -1922,7 +1922,7 @@ class SfCalendar extends StatefulWidget {
1922
1922
/// startTime: DateTime.now(),
1923
1923
/// endTime: DateTime.now().add(Duration(hours: 1)),
1924
1924
/// enablePointerInteraction: false,
1925
- /// color: Colors.grey.withOpacity( 0.2),
1925
+ /// color: Colors.grey.withValues(alpha: 0.2),
1926
1926
/// text: 'Break'));
1927
1927
///
1928
1928
/// return regions;
@@ -3879,15 +3879,15 @@ class _SfCalendarState extends State<SfCalendar>
3879
3879
? .merge (widget.blackoutDatesTextStyle),
3880
3880
trailingDatesTextStyle: themeData.textTheme.bodyMedium!
3881
3881
.copyWith (
3882
- color: colorScheme.onSurface.withOpacity ( 0.54 ),
3882
+ color: colorScheme.onSurface.withValues (alpha : 0.54 ),
3883
3883
fontSize: isMaterial3 ? 14 : 13 ,
3884
3884
)
3885
3885
.merge (calendarThemeData.trailingDatesTextStyle)
3886
3886
.merge (
3887
3887
widget.monthViewSettings.monthCellStyle.trailingDatesTextStyle),
3888
3888
leadingDatesTextStyle: themeData.textTheme.bodyMedium!
3889
3889
.copyWith (
3890
- color: colorScheme.onSurface.withOpacity ( 0.54 ),
3890
+ color: colorScheme.onSurface.withValues (alpha : 0.54 ),
3891
3891
fontSize: isMaterial3 ? 14 : 13 ,
3892
3892
)
3893
3893
.merge (calendarThemeData.leadingDatesTextStyle)
@@ -3902,37 +3902,37 @@ class _SfCalendarState extends State<SfCalendar>
3902
3902
.merge (widget.todayTextStyle),
3903
3903
headerTextStyle: themeData.textTheme.bodyLarge!
3904
3904
.copyWith (
3905
- color: colorScheme.onSurface.withOpacity ( 0.87 ),
3905
+ color: colorScheme.onSurface.withValues (alpha : 0.87 ),
3906
3906
fontSize: isMaterial3 ? 16 : 18 ,
3907
3907
fontWeight: FontWeight .w400,
3908
3908
)
3909
3909
.merge (calendarThemeData.headerTextStyle)
3910
3910
.merge (widget.headerStyle.textStyle),
3911
3911
activeDatesTextStyle: themeData.textTheme.bodyMedium!
3912
3912
.copyWith (
3913
- color: colorScheme.onSurface.withOpacity ( 0.87 ),
3913
+ color: colorScheme.onSurface.withValues (alpha : 0.87 ),
3914
3914
fontSize: 13 ,
3915
3915
)
3916
3916
.merge (calendarThemeData.activeDatesTextStyle)
3917
3917
.merge (widget.monthViewSettings.monthCellStyle.textStyle),
3918
3918
timeTextStyle: themeData.textTheme.bodySmall!
3919
3919
.copyWith (
3920
- color: colorScheme.onSurface.withOpacity ( 0.54 ),
3920
+ color: colorScheme.onSurface.withValues (alpha : 0.54 ),
3921
3921
fontSize: isMaterial3 ? 12 : 10 ,
3922
3922
fontWeight: FontWeight .w500,
3923
3923
)
3924
3924
.merge (calendarThemeData.timeTextStyle)
3925
3925
.merge (widget.timeSlotViewSettings.timeTextStyle),
3926
3926
viewHeaderDateTextStyle: themeData.textTheme.bodyMedium!
3927
3927
.copyWith (
3928
- color: colorScheme.onSurface.withOpacity ( 0.87 ),
3928
+ color: colorScheme.onSurface.withValues (alpha : 0.87 ),
3929
3929
fontSize: isMaterial3 ? 14 : 15 ,
3930
3930
)
3931
3931
.merge (calendarThemeData.viewHeaderDateTextStyle)
3932
3932
.merge (widget.viewHeaderStyle.dateTextStyle),
3933
3933
viewHeaderDayTextStyle: themeData.textTheme.bodySmall!
3934
3934
.copyWith (
3935
- color: colorScheme.onSurface.withOpacity ( 0.87 ),
3935
+ color: colorScheme.onSurface.withValues (alpha : 0.87 ),
3936
3936
fontSize: isMaterial3 ? 12 : 11 ,
3937
3937
)
3938
3938
.merge (calendarThemeData.viewHeaderDayTextStyle)
@@ -3947,7 +3947,7 @@ class _SfCalendarState extends State<SfCalendar>
3947
3947
.merge (widget.resourceViewSettings.displayNameTextStyle),
3948
3948
weekNumberTextStyle: themeData.textTheme.bodyMedium!
3949
3949
.copyWith (
3950
- color: colorScheme.onSurface.withOpacity ( 0.87 ),
3950
+ color: colorScheme.onSurface.withValues (alpha : 0.87 ),
3951
3951
fontSize: isMaterial3 ? 14 : 13 ,
3952
3952
)
3953
3953
.merge (calendarThemeData.weekNumberTextStyle)
@@ -5803,7 +5803,7 @@ class _SfCalendarState extends State<SfCalendar>
5803
5803
final double dividerHeight = _useMobilePlatformUI ? 0 : 1 ;
5804
5804
Color dividerColor =
5805
5805
widget.cellBorderColor ?? _calendarTheme.cellBorderColor! ;
5806
- dividerColor = dividerColor.withOpacity ( dividerColor.opacity * 0.5 );
5806
+ dividerColor = dividerColor.withValues (alpha : dividerColor.a * 0.5 );
5807
5807
int numberOfEvents = 0 ;
5808
5808
5809
5809
double appointmentHeight = 0 ;
@@ -9523,7 +9523,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
9523
9523
final Color headerBackgroundColor = widget.headerStyle.backgroundColor ??
9524
9524
widget.calendarTheme.headerBackgroundColor! ;
9525
9525
final Color arrowColor =
9526
- headerTextColor.withOpacity ( headerTextColor.opacity * 0.6 );
9526
+ headerTextColor.withValues (alpha : headerTextColor.a * 0.6 );
9527
9527
Color prevArrowColor = arrowColor;
9528
9528
Color nextArrowColor = arrowColor;
9529
9529
final TextStyle style = TextStyle (color: arrowColor);
@@ -9761,7 +9761,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
9761
9761
widget.maxDate,
9762
9762
dates,
9763
9763
widget.nonWorkingDays)) {
9764
- nextArrowColor = nextArrowColor.withOpacity ( nextArrowColor.opacity * 0.5 );
9764
+ nextArrowColor = nextArrowColor.withValues (alpha : nextArrowColor.a * 0.5 );
9765
9765
}
9766
9766
9767
9767
if (! DateTimeHelper .canMoveToPreviousView (
@@ -9771,7 +9771,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
9771
9771
widget.maxDate,
9772
9772
dates,
9773
9773
widget.nonWorkingDays)) {
9774
- prevArrowColor = prevArrowColor.withOpacity ( prevArrowColor.opacity * 0.5 );
9774
+ prevArrowColor = prevArrowColor.withValues (alpha : prevArrowColor.a * 0.5 );
9775
9775
}
9776
9776
9777
9777
MainAxisAlignment getAlignmentFromTextAlign () {
@@ -9923,7 +9923,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
9923
9923
decoration: BoxDecoration (
9924
9924
color:
9925
9925
widget.showDatePickerButton && widget.isPickerShown
9926
- ? Colors .grey.withOpacity ( 0.3 )
9926
+ ? Colors .grey.withValues (alpha : 0.3 )
9927
9927
: headerBackgroundColor,
9928
9928
),
9929
9929
@@ -10330,7 +10330,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
10330
10330
padding: EdgeInsets .all (useMobilePlatformUI ? 2 : 4 ),
10331
10331
child: Material (
10332
10332
color: isHighlighted && (isNeedIcon || useMobilePlatformUI)
10333
- ? Colors .grey.withOpacity ( 0.3 )
10333
+ ? Colors .grey.withValues (alpha : 0.3 )
10334
10334
: headerBackgroundColor,
10335
10335
child: InkWell (
10336
10336
splashColor: calendarViewSplashColor,
@@ -10642,7 +10642,7 @@ class _ScheduleLabelPainter extends CustomPainter {
10642
10642
final Rect rect = Rect .fromLTWH (
10643
10643
0 , padding, size.width - 2 , size.height - (2 * padding));
10644
10644
_backgroundPainter.color =
10645
- calendarTheme.selectionBorderColor! .withOpacity ( 0.4 );
10645
+ calendarTheme.selectionBorderColor! .withValues (alpha : 0.4 );
10646
10646
_backgroundPainter.style = PaintingStyle .stroke;
10647
10647
_backgroundPainter.strokeWidth = 2 ;
10648
10648
canvas.drawRect (rect, _backgroundPainter);
@@ -10654,7 +10654,7 @@ class _ScheduleLabelPainter extends CustomPainter {
10654
10654
padding + viewPadding,
10655
10655
size.width - (isRTL ? viewPadding : padding),
10656
10656
size.height - (2 * (viewPadding + padding)));
10657
- _backgroundPainter.color = Colors .grey.withOpacity ( 0.1 );
10657
+ _backgroundPainter.color = Colors .grey.withValues (alpha : 0.1 );
10658
10658
canvas.drawRRect (
10659
10659
RRect .fromRectAndRadius (rect, const Radius .circular (4 )),
10660
10660
_backgroundPainter);
@@ -11090,7 +11090,7 @@ class _CustomSplash extends InteractiveInkFeature {
11090
11090
..addListener (controller.markNeedsPaint)
11091
11091
..addStatusListener (_handleAlphaStatusChanged);
11092
11092
_alpha = _alphaController! .drive (IntTween (
11093
- begin: color.alpha ,
11093
+ begin: ( color.a * 255 ). toInt () ,
11094
11094
end: 0 ,
11095
11095
));
11096
11096
@@ -11260,7 +11260,7 @@ class _AgendaDateTimePainter extends CustomPainter {
11260
11260
/// Holds the default agenda day text style from framework text theme.
11261
11261
final TextStyle agendaDayThemeTextStyle =
11262
11262
themeData.textTheme.bodySmall! .copyWith (
11263
- color: themeData.colorScheme.onSurface.withOpacity ( 0.54 ),
11263
+ color: themeData.colorScheme.onSurface.withValues (alpha : 0.54 ),
11264
11264
fontSize: 10 ,
11265
11265
fontWeight: FontWeight .w500,
11266
11266
);
@@ -11394,11 +11394,11 @@ class _AgendaDateTimePainter extends CustomPainter {
11394
11394
yPosition + _textPainter.height >
11395
11395
agendaDateNotifier.value! .hoveringOffset.dy) {
11396
11396
_linePainter.color = isToday
11397
- ? Colors .black.withOpacity ( 0.1 )
11397
+ ? Colors .black.withValues (alpha : 0.1 )
11398
11398
: (themeData.brightness == Brightness .dark
11399
11399
? Colors .white
11400
11400
: Colors .black87)
11401
- .withOpacity ( 0.04 );
11401
+ .withValues (alpha : 0.04 );
11402
11402
_drawTodayCircle (canvas, xPosition, yPosition, padding);
11403
11403
}
11404
11404
}
@@ -11460,11 +11460,11 @@ class _AgendaDateTimePainter extends CustomPainter {
11460
11460
(yPosition + _textPainter.height) >
11461
11461
agendaDateNotifier.value! .hoveringOffset.dy) {
11462
11462
_linePainter.color = isToday
11463
- ? Colors .black.withOpacity ( 0.1 )
11463
+ ? Colors .black.withValues (alpha : 0.1 )
11464
11464
: (themeData.brightness == Brightness .dark
11465
11465
? Colors .white
11466
11466
: Colors .black87)
11467
- .withOpacity ( 0.04 );
11467
+ .withValues (alpha : 0.04 );
11468
11468
_drawTodayCircle (canvas, dateTextStartPosition, yPosition, padding);
11469
11469
}
11470
11470
}
0 commit comments