Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
e7f60807
Unverified
Commit
e7f60807
authored
Sep 03, 2019
by
LongCatIsLooong
Committed by
GitHub
Sep 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CupertinoActionSheet dark mode & fidelity (#39215)
parent
d8040970
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
221 additions
and
74 deletions
+221
-74
action_sheet.dart
packages/flutter/lib/src/cupertino/action_sheet.dart
+145
-65
colors.dart
packages/flutter/lib/src/cupertino/colors.dart
+8
-8
action_sheet_test.dart
packages/flutter/test/cupertino/action_sheet_test.dart
+68
-1
No files found.
packages/flutter/lib/src/cupertino/action_sheet.dart
View file @
e7f60807
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/cupertino/colors.dart
View file @
e7f60807
...
...
@@ -1089,14 +1089,14 @@ const CupertinoSystemColorsData _kSystemColorsFallback = CupertinoSystemColorsDa
darkHighContrastElevatedColor:
Color
.
fromARGB
(
255
,
36
,
36
,
38
),
),
secondarySystemGroupedBackground:
CupertinoDynamicColor
(
color:
Color
.
fromARGB
(
255
,
2
42
,
242
,
247
),
darkColor:
Color
.
fromARGB
(
255
,
0
,
0
,
0
),
highContrastColor:
Color
.
fromARGB
(
255
,
2
35
,
235
,
240
),
darkHighContrastColor:
Color
.
fromARGB
(
255
,
0
,
0
,
0
),
elevatedColor:
Color
.
fromARGB
(
255
,
2
42
,
242
,
247
),
darkElevatedColor:
Color
.
fromARGB
(
255
,
28
,
28
,
30
),
highContrastElevatedColor:
Color
.
fromARGB
(
255
,
2
35
,
235
,
240
),
darkHighContrastElevatedColor:
Color
.
fromARGB
(
255
,
36
,
36
,
38
),
color:
Color
.
fromARGB
(
255
,
2
55
,
255
,
255
),
darkColor:
Color
.
fromARGB
(
255
,
28
,
28
,
3
0
),
highContrastColor:
Color
.
fromARGB
(
255
,
2
55
,
255
,
255
),
darkHighContrastColor:
Color
.
fromARGB
(
255
,
36
,
36
,
38
),
elevatedColor:
Color
.
fromARGB
(
255
,
2
55
,
255
,
255
),
darkElevatedColor:
Color
.
fromARGB
(
255
,
44
,
44
,
46
),
highContrastElevatedColor:
Color
.
fromARGB
(
255
,
2
55
,
255
,
255
),
darkHighContrastElevatedColor:
Color
.
fromARGB
(
255
,
54
,
54
,
56
),
),
tertiarySystemGroupedBackground:
CupertinoDynamicColor
(
color:
Color
.
fromARGB
(
255
,
242
,
242
,
247
),
...
...
packages/flutter/test/cupertino/action_sheet_test.dart
View file @
e7f60807
...
...
@@ -7,6 +7,7 @@ import 'package:flutter/widgets.dart';
import
'package:flutter_test/flutter_test.dart'
;
import
'../rendering/mock_canvas.dart'
;
import
'../widgets/semantics_tester.dart'
;
void
main
(
)
{
...
...
@@ -61,7 +62,73 @@ void main() {
final
DefaultTextStyle
widget
=
tester
.
widget
(
find
.
widgetWithText
(
DefaultTextStyle
,
'Ok'
));
expect
(
widget
.
style
.
color
,
CupertinoColors
.
destructiveRed
);
expect
(
widget
.
style
.
color
,
const
CupertinoDynamicColor
.
withBrightnessAndContrast
(
color:
Color
.
fromARGB
(
255
,
255
,
59
,
48
),
darkColor:
Color
.
fromARGB
(
255
,
255
,
69
,
58
),
highContrastColor:
Color
.
fromARGB
(
255
,
215
,
0
,
21
),
darkHighContrastColor:
Color
.
fromARGB
(
255
,
255
,
105
,
97
),
));
});
testWidgets
(
'Action sheet dark mode'
,
(
WidgetTester
tester
)
async
{
final
Widget
action
=
CupertinoActionSheetAction
(
child:
const
Text
(
'action'
),
onPressed:
()
{},
);
Brightness
brightness
=
Brightness
.
light
;
StateSetter
stateSetter
;
TextStyle
actionTextStyle
(
String
text
)
{
return
tester
.
widget
<
DefaultTextStyle
>(
find
.
descendant
(
of:
find
.
widgetWithText
(
CupertinoActionSheetAction
,
text
),
matching:
find
.
byType
(
DefaultTextStyle
),
)
).
style
;
}
await
tester
.
pumpWidget
(
createAppWithButtonThatLaunchesActionSheet
(
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
setter
)
{
stateSetter
=
setter
;
return
CupertinoTheme
(
data:
CupertinoThemeData
(
brightness:
brightness
,
primaryColor:
const
CupertinoDynamicColor
.
withBrightnessAndContrast
(
color:
Color
.
fromARGB
(
255
,
0
,
122
,
255
),
darkColor:
Color
.
fromARGB
(
255
,
10
,
132
,
255
),
highContrastColor:
Color
.
fromARGB
(
255
,
0
,
64
,
221
),
darkHighContrastColor:
Color
.
fromARGB
(
255
,
64
,
156
,
255
),
),
),
child:
CupertinoActionSheet
(
actions:
<
Widget
>[
action
]),
);
},
),
),
);
await
tester
.
tap
(
find
.
text
(
'Go'
));
await
tester
.
pump
();
// Draw the overlay using the light variant.
expect
(
find
.
byType
(
CupertinoActionSheet
),
paints
..
rect
(
color:
const
Color
(
0x66000000
)));
expect
(
actionTextStyle
(
'action'
).
color
.
value
,
const
Color
.
fromARGB
(
255
,
0
,
122
,
255
).
value
,
);
stateSetter
(()
{
brightness
=
Brightness
.
dark
;
});
await
tester
.
pump
();
// Draw the overlay using the dark variant.
expect
(
find
.
byType
(
CupertinoActionSheet
),
paints
..
rect
(
color:
const
Color
(
0x99000000
)));
expect
(
actionTextStyle
(
'action'
).
color
.
value
,
const
Color
.
fromARGB
(
255
,
10
,
132
,
255
).
value
,
);
});
testWidgets
(
'Action sheet default text style'
,
(
WidgetTester
tester
)
async
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment