@@ -65,8 +65,9 @@ const TextStyle _kActionSheetContentStyle = TextStyle(
65
65
inherit: false ,
66
66
fontSize: 13.0 ,
67
67
fontWeight: FontWeight .w400,
68
- color: _kActionSheetContentTextColor,
69
68
textBaseline: TextBaseline .alphabetic,
69
+ // The `color` is configured by _kActionSheetContentTextColor to be dynamic on
70
+ // context.
70
71
);
71
72
72
73
// Generic constants shared between Dialog and ActionSheet.
@@ -104,35 +105,53 @@ const Color _kDialogColor = CupertinoDynamicColor.withBrightness(
104
105
// Translucent light gray that is painted on top of the blurred backdrop as the
105
106
// background color of a pressed button.
106
107
// Eyeballed from iOS 13 beta simulator.
107
- const Color _kPressedColor = CupertinoDynamicColor .withBrightness (
108
+ const Color _kDialogPressedColor = CupertinoDynamicColor .withBrightness (
108
109
color: Color (0xFFE1E1E1 ),
109
110
darkColor: Color (0xFF2E2E2E ),
110
111
);
111
112
113
+ // Translucent light gray that is painted on top of the blurred backdrop as the
114
+ // background color of a pressed button.
115
+ // Eyeballed from iOS 17 simulator.
116
+ const Color _kActionSheetPressedColor = CupertinoDynamicColor .withBrightness (
117
+ color: Color (0xCAE0E0E0 ),
118
+ darkColor: Color (0xC1515151 ),
119
+ );
120
+
121
+ const Color _kActionSheetCancelColor = CupertinoDynamicColor .withBrightness (
122
+ color: Color (0xFFFFFFFF ),
123
+ darkColor: Color (0xFF2C2C2C ),
124
+ );
112
125
const Color _kActionSheetCancelPressedColor = CupertinoDynamicColor .withBrightness (
113
126
color: Color (0xFFECECEC ),
114
- darkColor: Color (0xFF49494B ),
127
+ darkColor: Color (0xFF494949 ),
115
128
);
116
129
117
130
// Translucent, very light gray that is painted on top of the blurred backdrop
118
131
// as the action sheet's background color.
119
132
// TODO(LongCatIsLooong): https://github.com/flutter/flutter/issues/39272. Use
120
133
// System Materials once we have them.
121
- // Extracted from https://developer.apple.com/design/resources/ .
134
+ // Eyeballed from iOS 17 simulator .
122
135
const Color _kActionSheetBackgroundColor = CupertinoDynamicColor .withBrightness (
123
- color: Color (0xC7F9F9F9 ),
124
- darkColor: Color (0xC7252525 ),
136
+ color: Color (0xC8FCFCFC ),
137
+ darkColor: Color (0xBE292929 ),
125
138
);
126
139
127
140
// The gray color used for text that appears in the title area.
128
- // Extracted from https://developer.apple.com/design/resources/.
129
- const Color _kActionSheetContentTextColor = Color (0xFF8F8F8F );
141
+ // Eyeballed from iOS 17 simulator.
142
+ const Color _kActionSheetContentTextColor = CupertinoDynamicColor .withBrightness (
143
+ color: Color (0x851D1D1D ),
144
+ darkColor: Color (0x96F1F1F1 ),
145
+ );
130
146
131
147
// Translucent gray that is painted on top of the blurred backdrop in the gap
132
148
// areas between the content section and actions section, as well as between
133
149
// buttons.
134
- // Eye-balled from iOS 13 beta simulator.
135
- const Color _kActionSheetButtonDividerColor = _kActionSheetContentTextColor;
150
+ // Eyeballed from iOS 17 simulator.
151
+ const Color _kActionSheetButtonDividerColor = CupertinoDynamicColor .withBrightness (
152
+ color: Color (0xD4C9C9C9 ),
153
+ darkColor: Color (0xD57D7D7D ),
154
+ );
136
155
137
156
// The alert dialog layout policy changes depending on whether the user is using
138
157
// a "regular" font size vs a "large" font size. This is a spectrum. There are
@@ -841,6 +860,9 @@ class _CupertinoActionSheetState extends State<CupertinoActionSheet> {
841
860
842
861
Widget _buildContent (BuildContext context) {
843
862
final List <Widget > content = < Widget > [];
863
+ final TextStyle textStyle = _kActionSheetContentStyle.copyWith (
864
+ color: CupertinoDynamicColor .resolve (_kActionSheetContentTextColor, context),
865
+ );
844
866
if (hasContent) {
845
867
final Widget titleSection = _CupertinoAlertContentSection (
846
868
title: widget.title,
@@ -859,11 +881,11 @@ class _CupertinoActionSheetState extends State<CupertinoActionSheet> {
859
881
top: widget.title == null ? _kActionSheetContentVerticalPadding : 0.0 ,
860
882
),
861
883
titleTextStyle: widget.message == null
862
- ? _kActionSheetContentStyle
863
- : _kActionSheetContentStyle .copyWith (fontWeight: FontWeight .w600),
884
+ ? textStyle
885
+ : textStyle .copyWith (fontWeight: FontWeight .w600),
864
886
messageTextStyle: widget.title == null
865
- ? _kActionSheetContentStyle .copyWith (fontWeight: FontWeight .w600)
866
- : _kActionSheetContentStyle ,
887
+ ? textStyle .copyWith (fontWeight: FontWeight .w600)
888
+ : textStyle ,
867
889
additionalPaddingBetweenTitleAndMessage: const EdgeInsets .only (top: 4.0 ),
868
890
);
869
891
content.add (Flexible (child: titleSection));
@@ -908,7 +930,7 @@ class _CupertinoActionSheetState extends State<CupertinoActionSheet> {
908
930
hasContent: hasContent,
909
931
contentSection: Builder (builder: _buildContent),
910
932
actions: widget.actions,
911
- dividerColor: _kActionSheetButtonDividerColor,
933
+ dividerColor: CupertinoDynamicColor . resolve ( _kActionSheetButtonDividerColor, context) ,
912
934
),
913
935
),
914
936
),
@@ -1115,19 +1137,19 @@ class _ActionSheetButtonBackgroundState extends State<_ActionSheetButtonBackgrou
1115
1137
BorderRadius ? borderRadius;
1116
1138
if (! widget.isCancel) {
1117
1139
backgroundColor = isBeingPressed
1118
- ? _kPressedColor
1119
- : CupertinoDynamicColor . resolve ( _kActionSheetBackgroundColor, context) ;
1140
+ ? _kActionSheetPressedColor
1141
+ : _kActionSheetBackgroundColor;
1120
1142
} else {
1121
1143
backgroundColor = isBeingPressed
1122
- ? _kActionSheetCancelPressedColor
1123
- : CupertinoColors .secondarySystemGroupedBackground ;
1144
+ ? _kActionSheetCancelPressedColor
1145
+ : _kActionSheetCancelColor ;
1124
1146
borderRadius = const BorderRadius .all (Radius .circular (_kCornerRadius));
1125
1147
}
1126
1148
return MetaData (
1127
1149
metaData: this ,
1128
1150
child: Container (
1129
1151
decoration: BoxDecoration (
1130
- color: backgroundColor,
1152
+ color: CupertinoDynamicColor . resolve ( backgroundColor, context) ,
1131
1153
borderRadius: borderRadius,
1132
1154
),
1133
1155
child: widget.child,
@@ -2269,7 +2291,7 @@ class _CupertinoDialogActionsRenderWidget extends MultiChildRenderObjectWidget {
2269
2291
: _kCupertinoDialogWidth,
2270
2292
dividerThickness: _dividerThickness,
2271
2293
dialogColor: CupertinoDynamicColor .resolve (_kDialogColor, context),
2272
- dialogPressedColor: CupertinoDynamicColor .resolve (_kPressedColor , context),
2294
+ dialogPressedColor: CupertinoDynamicColor .resolve (_kDialogPressedColor , context),
2273
2295
dividerColor: CupertinoDynamicColor .resolve (CupertinoColors .separator, context),
2274
2296
hasCancelButton: _hasCancelButton,
2275
2297
);
@@ -2283,7 +2305,7 @@ class _CupertinoDialogActionsRenderWidget extends MultiChildRenderObjectWidget {
2283
2305
: _kCupertinoDialogWidth
2284
2306
..dividerThickness = _dividerThickness
2285
2307
..dialogColor = CupertinoDynamicColor .resolve (_kDialogColor, context)
2286
- ..dialogPressedColor = CupertinoDynamicColor .resolve (_kPressedColor , context)
2308
+ ..dialogPressedColor = CupertinoDynamicColor .resolve (_kDialogPressedColor , context)
2287
2309
..dividerColor = CupertinoDynamicColor .resolve (CupertinoColors .separator, context)
2288
2310
..hasCancelButton = _hasCancelButton;
2289
2311
}
0 commit comments