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