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
deb4184f
Unverified
Commit
deb4184f
authored
Sep 25, 2019
by
LongCatIsLooong
Committed by
GitHub
Sep 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove CupertinoSystemColors in favor of CupertinoColors (#40566)
parent
61c6c292
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
795 additions
and
1275 deletions
+795
-1275
action_sheet.dart
packages/flutter/lib/src/cupertino/action_sheet.dart
+2
-2
app.dart
packages/flutter/lib/src/cupertino/app.dart
+41
-44
button.dart
packages/flutter/lib/src/cupertino/button.dart
+8
-6
colors.dart
packages/flutter/lib/src/cupertino/colors.dart
+706
-1008
dialog.dart
packages/flutter/lib/src/cupertino/dialog.dart
+7
-7
slider.dart
packages/flutter/lib/src/cupertino/slider.dart
+2
-2
switch.dart
packages/flutter/lib/src/cupertino/switch.dart
+4
-4
bottom_tab_bar_test.dart
packages/flutter/test/cupertino/bottom_tab_bar_test.dart
+1
-1
button_test.dart
packages/flutter/test/cupertino/button_test.dart
+2
-2
colors_test.dart
packages/flutter/test/cupertino/colors_test.dart
+0
-180
dialog_test.dart
packages/flutter/test/cupertino/dialog_test.dart
+2
-2
tab_scaffold_test.dart
...es/flutter/test/cupertino/material/tab_scaffold_test.dart
+1
-1
nav_bar_test.dart
packages/flutter/test/cupertino/nav_bar_test.dart
+4
-3
nav_bar_transition_test.dart
packages/flutter/test/cupertino/nav_bar_transition_test.dart
+2
-2
segmented_control_test.dart
packages/flutter/test/cupertino/segmented_control_test.dart
+2
-2
slider_test.dart
packages/flutter/test/cupertino/slider_test.dart
+5
-3
tab_scaffold_test.dart
packages/flutter/test/cupertino/tab_scaffold_test.dart
+1
-1
text_field_test.dart
packages/flutter/test/cupertino/text_field_test.dart
+2
-2
theme_test.dart
packages/flutter/test/cupertino/theme_test.dart
+3
-3
No files found.
packages/flutter/lib/src/cupertino/action_sheet.dart
View file @
deb4184f
...
@@ -296,7 +296,7 @@ class CupertinoActionSheetAction extends StatelessWidget {
...
@@ -296,7 +296,7 @@ class CupertinoActionSheetAction extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
TextStyle
style
=
_kActionSheetActionStyle
.
copyWith
(
TextStyle
style
=
_kActionSheetActionStyle
.
copyWith
(
color:
isDestructiveAction
color:
isDestructiveAction
?
Cupertino
SystemColors
.
of
(
context
).
systemRed
?
Cupertino
DynamicColor
.
resolve
(
CupertinoColors
.
systemRed
,
context
)
:
CupertinoTheme
.
of
(
context
).
primaryColor
,
:
CupertinoTheme
.
of
(
context
).
primaryColor
,
);
);
...
@@ -362,7 +362,7 @@ class _CupertinoActionSheetCancelButtonState extends State<_CupertinoActionSheet
...
@@ -362,7 +362,7 @@ class _CupertinoActionSheetCancelButtonState extends State<_CupertinoActionSheet
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
final
Color
backgroundColor
=
isBeingPressed
final
Color
backgroundColor
=
isBeingPressed
?
_kCancelPressedColor
?
_kCancelPressedColor
:
Cupertino
SystemColors
.
of
(
context
)
.
secondarySystemGroupedBackground
;
:
Cupertino
Colors
.
secondarySystemGroupedBackground
;
return
GestureDetector
(
return
GestureDetector
(
excludeFromSemantics:
true
,
excludeFromSemantics:
true
,
onTapDown:
_onTapDown
,
onTapDown:
_onTapDown
,
...
...
packages/flutter/lib/src/cupertino/app.dart
View file @
deb4184f
...
@@ -273,50 +273,47 @@ class _CupertinoAppState extends State<CupertinoApp> {
...
@@ -273,50 +273,47 @@ class _CupertinoAppState extends State<CupertinoApp> {
data:
CupertinoUserInterfaceLevelData
.
base
,
data:
CupertinoUserInterfaceLevelData
.
base
,
child:
CupertinoTheme
(
child:
CupertinoTheme
(
data:
effectiveThemeData
,
data:
effectiveThemeData
,
child:
CupertinoSystemColors
(
child:
Builder
(
data:
CupertinoSystemColors
.
of
(
context
,
useFallbackValues:
true
),
builder:
(
BuildContext
context
)
{
child:
Builder
(
return
WidgetsApp
(
builder:
(
BuildContext
context
)
{
key:
GlobalObjectKey
(
this
),
return
WidgetsApp
(
navigatorKey:
widget
.
navigatorKey
,
key:
GlobalObjectKey
(
this
),
navigatorObservers:
_navigatorObservers
,
navigatorKey:
widget
.
navigatorKey
,
pageRouteBuilder:
<
T
>(
RouteSettings
settings
,
WidgetBuilder
builder
)
=>
navigatorObservers:
_navigatorObservers
,
CupertinoPageRoute
<
T
>(
settings:
settings
,
builder:
builder
),
pageRouteBuilder:
<
T
>(
RouteSettings
settings
,
WidgetBuilder
builder
)
=>
home:
widget
.
home
,
CupertinoPageRoute
<
T
>(
settings:
settings
,
builder:
builder
),
routes:
widget
.
routes
,
home:
widget
.
home
,
initialRoute:
widget
.
initialRoute
,
routes:
widget
.
routes
,
onGenerateRoute:
widget
.
onGenerateRoute
,
initialRoute:
widget
.
initialRoute
,
onUnknownRoute:
widget
.
onUnknownRoute
,
onGenerateRoute:
widget
.
onGenerateRoute
,
builder:
widget
.
builder
,
onUnknownRoute:
widget
.
onUnknownRoute
,
title:
widget
.
title
,
builder:
widget
.
builder
,
onGenerateTitle:
widget
.
onGenerateTitle
,
title:
widget
.
title
,
textStyle:
effectiveThemeData
.
textTheme
.
textStyle
,
onGenerateTitle:
widget
.
onGenerateTitle
,
color:
CupertinoDynamicColor
.
resolve
(
widget
.
color
??
effectiveThemeData
.
primaryColor
,
context
),
textStyle:
effectiveThemeData
.
textTheme
.
textStyle
,
locale:
widget
.
locale
,
color:
CupertinoDynamicColor
.
resolve
(
widget
.
color
??
effectiveThemeData
.
primaryColor
,
context
),
localizationsDelegates:
_localizationsDelegates
,
locale:
widget
.
locale
,
localeResolutionCallback:
widget
.
localeResolutionCallback
,
localizationsDelegates:
_localizationsDelegates
,
localeListResolutionCallback:
widget
.
localeListResolutionCallback
,
localeResolutionCallback:
widget
.
localeResolutionCallback
,
supportedLocales:
widget
.
supportedLocales
,
localeListResolutionCallback:
widget
.
localeListResolutionCallback
,
showPerformanceOverlay:
widget
.
showPerformanceOverlay
,
supportedLocales:
widget
.
supportedLocales
,
checkerboardRasterCacheImages:
widget
.
checkerboardRasterCacheImages
,
showPerformanceOverlay:
widget
.
showPerformanceOverlay
,
checkerboardOffscreenLayers:
widget
.
checkerboardOffscreenLayers
,
checkerboardRasterCacheImages:
widget
.
checkerboardRasterCacheImages
,
showSemanticsDebugger:
widget
.
showSemanticsDebugger
,
checkerboardOffscreenLayers:
widget
.
checkerboardOffscreenLayers
,
debugShowCheckedModeBanner:
widget
.
debugShowCheckedModeBanner
,
showSemanticsDebugger:
widget
.
showSemanticsDebugger
,
inspectorSelectButtonBuilder:
(
BuildContext
context
,
VoidCallback
onPressed
)
{
debugShowCheckedModeBanner:
widget
.
debugShowCheckedModeBanner
,
return
CupertinoButton
.
filled
(
inspectorSelectButtonBuilder:
(
BuildContext
context
,
VoidCallback
onPressed
)
{
child:
const
Icon
(
return
CupertinoButton
.
filled
(
CupertinoIcons
.
search
,
child:
const
Icon
(
size:
28.0
,
CupertinoIcons
.
search
,
color:
CupertinoColors
.
white
,
size:
28.0
,
),
color:
CupertinoColors
.
white
,
padding:
EdgeInsets
.
zero
,
),
onPressed:
onPressed
,
padding:
EdgeInsets
.
zero
,
);
onPressed:
onPressed
,
},
);
);
},
},
);
},
),
),
),
),
),
),
),
...
...
packages/flutter/lib/src/cupertino/button.dart
View file @
deb4184f
...
@@ -31,12 +31,13 @@ class CupertinoButton extends StatefulWidget {
...
@@ -31,12 +31,13 @@ class CupertinoButton extends StatefulWidget {
@required
this
.
child
,
@required
this
.
child
,
this
.
padding
,
this
.
padding
,
this
.
color
,
this
.
color
,
this
.
disabledColor
,
this
.
disabledColor
=
CupertinoColors
.
quaternarySystemFill
,
this
.
minSize
=
kMinInteractiveDimensionCupertino
,
this
.
minSize
=
kMinInteractiveDimensionCupertino
,
this
.
pressedOpacity
=
0.1
,
this
.
pressedOpacity
=
0.1
,
this
.
borderRadius
=
const
BorderRadius
.
all
(
Radius
.
circular
(
8.0
)),
this
.
borderRadius
=
const
BorderRadius
.
all
(
Radius
.
circular
(
8.0
)),
@required
this
.
onPressed
,
@required
this
.
onPressed
,
})
:
assert
(
pressedOpacity
==
null
||
(
pressedOpacity
>=
0.0
&&
pressedOpacity
<=
1.0
)),
})
:
assert
(
pressedOpacity
==
null
||
(
pressedOpacity
>=
0.0
&&
pressedOpacity
<=
1.0
)),
assert
(
disabledColor
!=
null
),
_filled
=
false
,
_filled
=
false
,
super
(
key:
key
);
super
(
key:
key
);
...
@@ -50,12 +51,13 @@ class CupertinoButton extends StatefulWidget {
...
@@ -50,12 +51,13 @@ class CupertinoButton extends StatefulWidget {
Key
key
,
Key
key
,
@required
this
.
child
,
@required
this
.
child
,
this
.
padding
,
this
.
padding
,
this
.
disabledColor
,
this
.
disabledColor
=
CupertinoColors
.
quaternarySystemFill
,
this
.
minSize
=
kMinInteractiveDimensionCupertino
,
this
.
minSize
=
kMinInteractiveDimensionCupertino
,
this
.
pressedOpacity
=
0.1
,
this
.
pressedOpacity
=
0.1
,
this
.
borderRadius
=
const
BorderRadius
.
all
(
Radius
.
circular
(
8.0
)),
this
.
borderRadius
=
const
BorderRadius
.
all
(
Radius
.
circular
(
8.0
)),
@required
this
.
onPressed
,
@required
this
.
onPressed
,
})
:
assert
(
pressedOpacity
==
null
||
(
pressedOpacity
>=
0.0
&&
pressedOpacity
<=
1.0
)),
})
:
assert
(
pressedOpacity
==
null
||
(
pressedOpacity
>=
0.0
&&
pressedOpacity
<=
1.0
)),
assert
(
disabledColor
!=
null
),
color
=
null
,
color
=
null
,
_filled
=
true
,
_filled
=
true
,
super
(
key:
key
);
super
(
key:
key
);
...
@@ -82,8 +84,8 @@ class CupertinoButton extends StatefulWidget {
...
@@ -82,8 +84,8 @@ class CupertinoButton extends StatefulWidget {
///
///
/// Ignored if the [CupertinoButton] doesn't also have a [color].
/// Ignored if the [CupertinoButton] doesn't also have a [color].
///
///
/// Defaults to [Cupertino
System
Colors.quaternarySystemFill] when [color] is
/// Defaults to [CupertinoColors.quaternarySystemFill] when [color] is
/// specified
and [disabledColor] is
null.
/// specified
. Must not be
null.
final
Color
disabledColor
;
final
Color
disabledColor
;
/// The callback that is called when the button is tapped or otherwise activated.
/// The callback that is called when the button is tapped or otherwise activated.
...
@@ -214,7 +216,7 @@ class _CupertinoButtonState extends State<CupertinoButton> with SingleTickerProv
...
@@ -214,7 +216,7 @@ class _CupertinoButtonState extends State<CupertinoButton> with SingleTickerProv
?
themeData
.
primaryContrastingColor
?
themeData
.
primaryContrastingColor
:
enabled
:
enabled
?
primaryColor
?
primaryColor
:
CupertinoDynamicColor
.
resolve
(
Cupertino
SystemColors
.
of
(
context
)
.
placeholderText
,
context
);
:
CupertinoDynamicColor
.
resolve
(
Cupertino
Colors
.
placeholderText
,
context
);
final
TextStyle
textStyle
=
themeData
.
textTheme
.
textStyle
.
copyWith
(
color:
foregroundColor
);
final
TextStyle
textStyle
=
themeData
.
textTheme
.
textStyle
.
copyWith
(
color:
foregroundColor
);
...
@@ -239,7 +241,7 @@ class _CupertinoButtonState extends State<CupertinoButton> with SingleTickerProv
...
@@ -239,7 +241,7 @@ class _CupertinoButtonState extends State<CupertinoButton> with SingleTickerProv
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
borderRadius:
widget
.
borderRadius
,
borderRadius:
widget
.
borderRadius
,
color:
backgroundColor
!=
null
&&
!
enabled
color:
backgroundColor
!=
null
&&
!
enabled
?
CupertinoDynamicColor
.
resolve
(
widget
.
disabledColor
??
CupertinoSystemColors
.
of
(
context
).
quaternarySystemFill
,
context
)
?
CupertinoDynamicColor
.
resolve
(
widget
.
disabledColor
,
context
)
:
backgroundColor
,
:
backgroundColor
,
),
),
child:
Padding
(
child:
Padding
(
...
...
packages/flutter/lib/src/cupertino/colors.dart
View file @
deb4184f
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/cupertino/dialog.dart
View file @
deb4184f
...
@@ -360,7 +360,7 @@ class _CupertinoDialogRenderWidget extends RenderObjectWidget {
...
@@ -360,7 +360,7 @@ class _CupertinoDialogRenderWidget extends RenderObjectWidget {
return
_RenderCupertinoDialog
(
return
_RenderCupertinoDialog
(
dividerThickness:
_kDividerThickness
/
MediaQuery
.
of
(
context
).
devicePixelRatio
,
dividerThickness:
_kDividerThickness
/
MediaQuery
.
of
(
context
).
devicePixelRatio
,
isInAccessibilityMode:
_isInAccessibilityMode
(
context
),
isInAccessibilityMode:
_isInAccessibilityMode
(
context
),
dividerColor:
CupertinoDynamicColor
.
resolve
(
Cupertino
SystemColors
.
of
(
context
)
.
separator
,
context
),
dividerColor:
CupertinoDynamicColor
.
resolve
(
Cupertino
Colors
.
separator
,
context
),
);
);
}
}
...
@@ -368,7 +368,7 @@ class _CupertinoDialogRenderWidget extends RenderObjectWidget {
...
@@ -368,7 +368,7 @@ class _CupertinoDialogRenderWidget extends RenderObjectWidget {
void
updateRenderObject
(
BuildContext
context
,
_RenderCupertinoDialog
renderObject
)
{
void
updateRenderObject
(
BuildContext
context
,
_RenderCupertinoDialog
renderObject
)
{
renderObject
renderObject
..
isInAccessibilityMode
=
_isInAccessibilityMode
(
context
)
..
isInAccessibilityMode
=
_isInAccessibilityMode
(
context
)
..
dividerColor
=
CupertinoDynamicColor
.
resolve
(
Cupertino
SystemColors
.
of
(
context
)
.
separator
,
context
);
..
dividerColor
=
CupertinoDynamicColor
.
resolve
(
Cupertino
Colors
.
separator
,
context
);
}
}
@override
@override
...
@@ -858,7 +858,7 @@ class _CupertinoAlertContentSection extends StatelessWidget {
...
@@ -858,7 +858,7 @@ class _CupertinoAlertContentSection extends StatelessWidget {
),
),
child:
DefaultTextStyle
(
child:
DefaultTextStyle
(
style:
_kCupertinoDialogTitleStyle
.
copyWith
(
style:
_kCupertinoDialogTitleStyle
.
copyWith
(
color:
CupertinoDynamicColor
.
resolve
(
Cupertino
SystemColors
.
of
(
context
)
.
label
,
context
),
color:
CupertinoDynamicColor
.
resolve
(
Cupertino
Colors
.
label
,
context
),
),
),
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
child:
title
,
child:
title
,
...
@@ -874,7 +874,7 @@ class _CupertinoAlertContentSection extends StatelessWidget {
...
@@ -874,7 +874,7 @@ class _CupertinoAlertContentSection extends StatelessWidget {
),
),
child:
DefaultTextStyle
(
child:
DefaultTextStyle
(
style:
_kCupertinoDialogContentStyle
.
copyWith
(
style:
_kCupertinoDialogContentStyle
.
copyWith
(
color:
CupertinoDynamicColor
.
resolve
(
Cupertino
SystemColors
.
of
(
context
)
.
label
,
context
),
color:
CupertinoDynamicColor
.
resolve
(
Cupertino
Colors
.
label
,
context
),
),
),
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
child:
content
,
child:
content
,
...
@@ -1158,7 +1158,7 @@ class CupertinoDialogAction extends StatelessWidget {
...
@@ -1158,7 +1158,7 @@ class CupertinoDialogAction extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
TextStyle
style
=
_kCupertinoDialogActionStyle
.
copyWith
(
TextStyle
style
=
_kCupertinoDialogActionStyle
.
copyWith
(
color:
CupertinoDynamicColor
.
resolve
(
color:
CupertinoDynamicColor
.
resolve
(
isDestructiveAction
?
Cupertino
SystemColors
.
of
(
context
).
systemRed
:
CupertinoSystemColors
.
of
(
context
)
.
systemBlue
,
isDestructiveAction
?
Cupertino
Colors
.
systemRed
:
CupertinoColors
.
systemBlue
,
context
,
context
,
),
),
);
);
...
@@ -1233,7 +1233,7 @@ class _CupertinoDialogActionsRenderWidget extends MultiChildRenderObjectWidget {
...
@@ -1233,7 +1233,7 @@ class _CupertinoDialogActionsRenderWidget extends MultiChildRenderObjectWidget {
dividerThickness:
_dividerThickness
,
dividerThickness:
_dividerThickness
,
dialogColor:
CupertinoDynamicColor
.
resolve
(
_kDialogColor
,
context
),
dialogColor:
CupertinoDynamicColor
.
resolve
(
_kDialogColor
,
context
),
dialogPressedColor:
CupertinoDynamicColor
.
resolve
(
_kDialogPressedColor
,
context
),
dialogPressedColor:
CupertinoDynamicColor
.
resolve
(
_kDialogPressedColor
,
context
),
dividerColor:
CupertinoDynamicColor
.
resolve
(
Cupertino
SystemColors
.
of
(
context
)
.
separator
,
context
),
dividerColor:
CupertinoDynamicColor
.
resolve
(
Cupertino
Colors
.
separator
,
context
),
);
);
}
}
...
@@ -1246,7 +1246,7 @@ class _CupertinoDialogActionsRenderWidget extends MultiChildRenderObjectWidget {
...
@@ -1246,7 +1246,7 @@ class _CupertinoDialogActionsRenderWidget extends MultiChildRenderObjectWidget {
..
dividerThickness
=
_dividerThickness
..
dividerThickness
=
_dividerThickness
..
dialogColor
=
CupertinoDynamicColor
.
resolve
(
_kDialogColor
,
context
)
..
dialogColor
=
CupertinoDynamicColor
.
resolve
(
_kDialogColor
,
context
)
..
dialogPressedColor
=
CupertinoDynamicColor
.
resolve
(
_kDialogPressedColor
,
context
)
..
dialogPressedColor
=
CupertinoDynamicColor
.
resolve
(
_kDialogPressedColor
,
context
)
..
dividerColor
=
CupertinoDynamicColor
.
resolve
(
Cupertino
SystemColors
.
of
(
context
)
.
separator
,
context
);
..
dividerColor
=
CupertinoDynamicColor
.
resolve
(
Cupertino
Colors
.
separator
,
context
);
}
}
}
}
...
...
packages/flutter/lib/src/cupertino/slider.dart
View file @
deb4184f
...
@@ -268,7 +268,7 @@ class _CupertinoSliderRenderObjectWidget extends LeafRenderObjectWidget {
...
@@ -268,7 +268,7 @@ class _CupertinoSliderRenderObjectWidget extends LeafRenderObjectWidget {
value:
value
,
value:
value
,
divisions:
divisions
,
divisions:
divisions
,
activeColor:
activeColor
,
activeColor:
activeColor
,
trackColor:
CupertinoDynamicColor
.
resolve
(
Cupertino
SystemColors
.
of
(
context
)
.
systemFill
,
context
),
trackColor:
CupertinoDynamicColor
.
resolve
(
Cupertino
Colors
.
systemFill
,
context
),
onChanged:
onChanged
,
onChanged:
onChanged
,
onChangeStart:
onChangeStart
,
onChangeStart:
onChangeStart
,
onChangeEnd:
onChangeEnd
,
onChangeEnd:
onChangeEnd
,
...
@@ -283,7 +283,7 @@ class _CupertinoSliderRenderObjectWidget extends LeafRenderObjectWidget {
...
@@ -283,7 +283,7 @@ class _CupertinoSliderRenderObjectWidget extends LeafRenderObjectWidget {
..
value
=
value
..
value
=
value
..
divisions
=
divisions
..
divisions
=
divisions
..
activeColor
=
activeColor
..
activeColor
=
activeColor
..
trackColor
=
CupertinoDynamicColor
.
resolve
(
Cupertino
SystemColors
.
of
(
context
)
.
systemFill
,
context
)
..
trackColor
=
CupertinoDynamicColor
.
resolve
(
Cupertino
Colors
.
systemFill
,
context
)
..
onChanged
=
onChanged
..
onChanged
=
onChanged
..
onChangeStart
=
onChangeStart
..
onChangeStart
=
onChangeStart
..
onChangeEnd
=
onChangeEnd
..
onChangeEnd
=
onChangeEnd
...
...
packages/flutter/lib/src/cupertino/switch.dart
View file @
deb4184f
...
@@ -96,7 +96,7 @@ class CupertinoSwitch extends StatefulWidget {
...
@@ -96,7 +96,7 @@ class CupertinoSwitch extends StatefulWidget {
/// The color to use when this switch is on.
/// The color to use when this switch is on.
///
///
/// Defaults to [Cupertino
SystemColorsData
.systemGreen] when null and ignores
/// Defaults to [Cupertino
Colors
.systemGreen] when null and ignores
/// the [CupertinoTheme] in accordance to native iOS behavior.
/// the [CupertinoTheme] in accordance to native iOS behavior.
final
Color
activeColor
;
final
Color
activeColor
;
...
@@ -141,7 +141,7 @@ class _CupertinoSwitchState extends State<CupertinoSwitch> with TickerProviderSt
...
@@ -141,7 +141,7 @@ class _CupertinoSwitchState extends State<CupertinoSwitch> with TickerProviderSt
child:
_CupertinoSwitchRenderObjectWidget
(
child:
_CupertinoSwitchRenderObjectWidget
(
value:
widget
.
value
,
value:
widget
.
value
,
activeColor:
CupertinoDynamicColor
.
resolve
(
activeColor:
CupertinoDynamicColor
.
resolve
(
widget
.
activeColor
??
Cupertino
SystemColors
.
of
(
context
)
.
systemGreen
,
widget
.
activeColor
??
Cupertino
Colors
.
systemGreen
,
context
,
context
,
),
),
onChanged:
widget
.
onChanged
,
onChanged:
widget
.
onChanged
,
...
@@ -173,7 +173,7 @@ class _CupertinoSwitchRenderObjectWidget extends LeafRenderObjectWidget {
...
@@ -173,7 +173,7 @@ class _CupertinoSwitchRenderObjectWidget extends LeafRenderObjectWidget {
return
_RenderCupertinoSwitch
(
return
_RenderCupertinoSwitch
(
value:
value
,
value:
value
,
activeColor:
activeColor
,
activeColor:
activeColor
,
trackColor:
CupertinoDynamicColor
.
resolve
(
Cupertino
SystemColors
.
of
(
context
)
.
secondarySystemFill
,
context
),
trackColor:
CupertinoDynamicColor
.
resolve
(
Cupertino
Colors
.
secondarySystemFill
,
context
),
onChanged:
onChanged
,
onChanged:
onChanged
,
textDirection:
Directionality
.
of
(
context
),
textDirection:
Directionality
.
of
(
context
),
vsync:
vsync
,
vsync:
vsync
,
...
@@ -186,7 +186,7 @@ class _CupertinoSwitchRenderObjectWidget extends LeafRenderObjectWidget {
...
@@ -186,7 +186,7 @@ class _CupertinoSwitchRenderObjectWidget extends LeafRenderObjectWidget {
renderObject
renderObject
..
value
=
value
..
value
=
value
..
activeColor
=
activeColor
..
activeColor
=
activeColor
..
trackColor
=
CupertinoDynamicColor
.
resolve
(
Cupertino
SystemColors
.
of
(
context
)
.
secondarySystemFill
,
context
)
..
trackColor
=
CupertinoDynamicColor
.
resolve
(
Cupertino
Colors
.
secondarySystemFill
,
context
)
..
onChanged
=
onChanged
..
onChanged
=
onChanged
..
textDirection
=
Directionality
.
of
(
context
)
..
textDirection
=
Directionality
.
of
(
context
)
..
vsync
=
vsync
..
vsync
=
vsync
...
...
packages/flutter/test/cupertino/bottom_tab_bar_test.dart
View file @
deb4184f
...
@@ -217,8 +217,8 @@ void main() {
...
@@ -217,8 +217,8 @@ void main() {
of:
find
.
text
(
'Tab 2'
),
of:
find
.
text
(
'Tab 2'
),
matching:
find
.
byType
(
RichText
),
matching:
find
.
byType
(
RichText
),
));
));
expect
(
actualActive
.
text
.
style
.
color
,
CupertinoColors
.
activeOrange
);
expect
(
actualActive
.
text
.
style
.
color
.
value
,
CupertinoColors
.
activeOrange
.
darkColor
.
value
);
});
});
testWidgets
(
'Use active icon'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Use active icon'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/cupertino/button_test.dart
View file @
deb4184f
...
@@ -327,7 +327,7 @@ void main() {
...
@@ -327,7 +327,7 @@ void main() {
),
),
),
),
);
);
expect
(
textStyle
.
color
,
CupertinoColors
.
activeOrang
e
);
expect
(
textStyle
.
color
.
value
,
CupertinoColors
.
activeOrange
.
darkColor
.
valu
e
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
CupertinoApp
(
CupertinoApp
(
...
@@ -348,7 +348,7 @@ void main() {
...
@@ -348,7 +348,7 @@ void main() {
matching:
find
.
byType
(
DecoratedBox
),
matching:
find
.
byType
(
DecoratedBox
),
)
)
).
decoration
;
).
decoration
;
expect
(
decoration
.
color
,
CupertinoColors
.
activeOrang
e
);
expect
(
decoration
.
color
.
value
,
CupertinoColors
.
activeOrange
.
darkColor
.
valu
e
);
});
});
}
}
...
...
packages/flutter/test/cupertino/colors_test.dart
View file @
deb4184f
...
@@ -415,76 +415,6 @@ void main() {
...
@@ -415,76 +415,6 @@ void main() {
expect
(
find
.
byType
(
DependentWidget
),
paints
..
rect
(
color:
color7
));
expect
(
find
.
byType
(
DependentWidget
),
paints
..
rect
(
color:
color7
));
});
});
group
(
'CupertinoSystemColors widget'
,
()
{
CupertinoSystemColorsData
colors
;
setUp
(()
{
colors
=
null
;
});
Widget
systemColorGetter
(
BuildContext
context
)
{
colors
=
CupertinoSystemColors
.
of
(
context
);
return
const
Placeholder
();
}
const
CupertinoDynamicColor
kSystemBackground
=
CupertinoDynamicColor
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
darkColor:
Color
.
fromARGB
(
255
,
0
,
0
,
0
),
highContrastColor:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
darkHighContrastColor:
Color
.
fromARGB
(
255
,
0
,
0
,
0
),
elevatedColor:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
darkElevatedColor:
Color
.
fromARGB
(
255
,
28
,
28
,
30
),
highContrastElevatedColor:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
darkHighContrastElevatedColor:
Color
.
fromARGB
(
255
,
36
,
36
,
38
),
);
testWidgets
(
'exists in CupertinoApp'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
CupertinoApp
(
home:
Builder
(
builder:
systemColorGetter
)));
expect
(
colors
.
systemBackground
,
kSystemBackground
);
});
testWidgets
(
'resolves against its own BuildContext'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
CupertinoApp
(
theme:
const
CupertinoThemeData
(
brightness:
Brightness
.
dark
),
home:
CupertinoUserInterfaceLevel
(
data:
CupertinoUserInterfaceLevelData
.
elevated
,
child:
Builder
(
builder:
(
BuildContext
context
)
{
return
CupertinoSystemColors
(
child:
Builder
(
builder:
systemColorGetter
),
data:
CupertinoSystemColors
.
of
(
context
).
resolveColors
(
context
),
);
},
),
),
),
);
// In widget tests the OS colors should fallback to `fallbackValues`.
expect
(
colors
.
systemBackground
,
isNot
(
kSystemBackground
));
expect
(
colors
.
systemBackground
.
value
,
kSystemBackground
.
darkElevatedColor
.
value
);
colors
=
null
;
// Changing dependencies works.
await
tester
.
pumpWidget
(
CupertinoApp
(
theme:
const
CupertinoThemeData
(
brightness:
Brightness
.
light
),
home:
Builder
(
builder:
(
BuildContext
context
)
{
return
CupertinoUserInterfaceLevel
(
data:
CupertinoUserInterfaceLevelData
.
elevated
,
child:
CupertinoSystemColors
(
child:
Builder
(
builder:
systemColorGetter
),
data:
CupertinoSystemColors
.
of
(
context
).
resolveColors
(
context
),
),
);
},
),
),
);
expect
(
colors
.
systemBackground
.
value
,
kSystemBackground
.
elevatedColor
.
value
);
});
});
testWidgets
(
'CupertinoDynamicColor used in a CupertinoTheme'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'CupertinoDynamicColor used in a CupertinoTheme'
,
(
WidgetTester
tester
)
async
{
CupertinoDynamicColor
color
;
CupertinoDynamicColor
color
;
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -652,114 +582,4 @@ void main() {
...
@@ -652,114 +582,4 @@ void main() {
expect
(
color
,
isNot
(
dynamicColor
.
darkHighContrastElevatedColor
));
expect
(
color
,
isNot
(
dynamicColor
.
darkHighContrastElevatedColor
));
});
});
});
});
group
(
'CupertinoSystemColors'
,
()
{
const
Color
dynamicColor0
=
CupertinoDynamicColor
.
withBrightness
(
color:
Color
(
0x00000000
),
darkColor:
Color
(
0x00000000
),
);
const
Color
dynamicColor1
=
CupertinoDynamicColor
.
withBrightness
(
color:
Color
(
0x00000001
),
darkColor:
Color
(
0x00000000
),
);
const
CupertinoSystemColorsData
system0
=
CupertinoSystemColorsData
(
label:
dynamicColor0
,
secondaryLabel:
dynamicColor0
,
tertiaryLabel:
dynamicColor0
,
quaternaryLabel:
dynamicColor0
,
systemFill:
dynamicColor0
,
secondarySystemFill:
dynamicColor0
,
tertiarySystemFill:
dynamicColor0
,
quaternarySystemFill:
dynamicColor0
,
placeholderText:
dynamicColor0
,
systemBackground:
dynamicColor0
,
secondarySystemBackground:
dynamicColor0
,
tertiarySystemBackground:
dynamicColor0
,
systemGroupedBackground:
dynamicColor0
,
secondarySystemGroupedBackground:
dynamicColor0
,
tertiarySystemGroupedBackground:
dynamicColor0
,
separator:
dynamicColor0
,
opaqueSeparator:
dynamicColor0
,
link:
dynamicColor0
,
systemBlue:
dynamicColor0
,
systemGreen:
dynamicColor0
,
systemIndigo:
dynamicColor0
,
systemOrange:
dynamicColor0
,
systemPink:
dynamicColor0
,
systemPurple:
dynamicColor0
,
systemRed:
dynamicColor0
,
systemTeal:
dynamicColor0
,
systemYellow:
dynamicColor0
,
systemGray:
dynamicColor0
,
systemGray2:
dynamicColor0
,
systemGray3:
dynamicColor0
,
systemGray4:
dynamicColor0
,
systemGray5:
dynamicColor0
,
systemGray6:
dynamicColor0
,
);
test
(
'CupertinoSystemColorsData.== and CupertinoSystemColorsData.copyWith'
,
()
{
expect
(
system0
,
system0
);
expect
(
system0
,
system0
.
copyWith
());
expect
(
system0
,
system0
.
copyWith
(
link:
dynamicColor0
));
final
CupertinoSystemColorsData
withDifferentLink
=
system0
.
copyWith
(
link:
dynamicColor1
);
expect
(
withDifferentLink
.
link
,
dynamicColor1
);
expect
(
system0
,
isNot
(
withDifferentLink
));
});
test
(
'CupertinoSystemColorsData.hashCode'
,
()
{
expect
(
system0
.
hashCode
,
system0
.
hashCode
);
expect
(
system0
.
hashCode
,
system0
.
copyWith
().
hashCode
);
expect
(
system0
.
hashCode
,
system0
.
copyWith
(
link:
dynamicColor0
).
hashCode
);
expect
(
system0
.
hashCode
,
isNot
(
system0
.
copyWith
(
link:
dynamicColor1
).
hashCode
));
});
test
(
'CupertinoSystemColorsData.debugFillProperties'
,
()
{
final
DiagnosticPropertiesBuilder
builder
=
DiagnosticPropertiesBuilder
();
system0
.
debugFillProperties
(
builder
);
expect
(
builder
.
properties
.
where
((
DiagnosticsNode
node
)
=>
!
node
.
isFiltered
(
DiagnosticLevel
.
info
))
.
map
((
DiagnosticsNode
node
)
=>
node
.
toString
())
.
toList
(),
<
String
>[
'label: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'secondaryLabel: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'tertiaryLabel: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'quaternaryLabel: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemFill: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'secondarySystemFill: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'tertiarySystemFill: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'quaternarySystemFill: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'placeholderText: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemBackground: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'secondarySystemBackground: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'tertiarySystemBackground: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemGroupedBackground: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'secondarySystemGroupedBackground: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'tertiarySystemGroupedBackground: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'separator: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'opaqueSeparator: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'link: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemBlue: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemGreen: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemIndigo: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemOrange: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemPink: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemPurple: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemRed: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemTeal: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemYellow: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemGray: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemGray2: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemGray3: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemGray4: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemGray5: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
'systemGray6: CupertinoDynamicColor(*color = Color(0x00000000)*)'
,
],
);
});
});
}
}
packages/flutter/test/cupertino/dialog_test.dart
View file @
deb4184f
...
@@ -60,7 +60,7 @@ void main() {
...
@@ -60,7 +60,7 @@ void main() {
final
DefaultTextStyle
widget
=
tester
.
widget
(
find
.
byType
(
DefaultTextStyle
));
final
DefaultTextStyle
widget
=
tester
.
widget
(
find
.
byType
(
DefaultTextStyle
));
expect
(
widget
.
style
.
color
.
withAlpha
(
255
)
,
CupertinoColors
.
destructiveRed
);
expect
(
widget
.
style
.
color
.
withAlpha
(
255
)
.
value
,
CupertinoColors
.
destructiveRed
.
value
);
});
});
testWidgets
(
'Dialog dark theme'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Dialog dark theme'
,
(
WidgetTester
tester
)
async
{
...
@@ -183,7 +183,7 @@ void main() {
...
@@ -183,7 +183,7 @@ void main() {
final
DefaultTextStyle
widget
=
tester
.
widget
(
find
.
byType
(
DefaultTextStyle
));
final
DefaultTextStyle
widget
=
tester
.
widget
(
find
.
byType
(
DefaultTextStyle
));
expect
(
widget
.
style
.
color
.
withAlpha
(
255
)
,
CupertinoColors
.
destructiveRed
);
expect
(
widget
.
style
.
color
.
withAlpha
(
255
)
.
value
,
CupertinoColors
.
destructiveRed
.
value
);
expect
(
widget
.
style
.
fontWeight
,
equals
(
FontWeight
.
w600
));
expect
(
widget
.
style
.
fontWeight
,
equals
(
FontWeight
.
w600
));
});
});
...
...
packages/flutter/test/cupertino/material/tab_scaffold_test.dart
View file @
deb4184f
...
@@ -171,7 +171,7 @@ void main() {
...
@@ -171,7 +171,7 @@ void main() {
of:
find
.
text
(
'Tab 2'
),
of:
find
.
text
(
'Tab 2'
),
matching:
find
.
byType
(
RichText
),
matching:
find
.
byType
(
RichText
),
));
));
expect
(
tab2
.
text
.
style
.
color
,
CupertinoColors
.
destructiveRed
);
expect
(
tab2
.
text
.
style
.
color
.
value
,
CupertinoColors
.
systemRed
.
darkColor
.
value
);
});
});
testWidgets
(
'Does not lose state when focusing on text input'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Does not lose state when focusing on text input'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/cupertino/nav_bar_test.dart
View file @
deb4184f
...
@@ -188,18 +188,19 @@ void main() {
...
@@ -188,18 +188,19 @@ void main() {
testWidgets
(
'Nav bar respects themes'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Nav bar respects themes'
,
(
WidgetTester
tester
)
async
{
count
=
0x000000
;
count
=
0x000000
;
const
CupertinoDynamicColor
orange
=
CupertinoColors
.
activeOrange
;
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
CupertinoApp
(
CupertinoApp
(
theme:
const
CupertinoThemeData
(
brightness:
Brightness
.
dark
),
theme:
const
CupertinoThemeData
(
brightness:
Brightness
.
dark
),
home:
CupertinoNavigationBar
(
home:
CupertinoNavigationBar
(
leading:
CupertinoButton
(
leading:
CupertinoButton
(
onPressed:
()
{
},
onPressed:
()
{
},
child:
const
_ExpectStyles
(
color:
CupertinoColors
.
activeOrange
,
index:
0x000001
),
child:
_ExpectStyles
(
color:
orange
.
darkColor
,
index:
0x000001
),
),
),
middle:
const
_ExpectStyles
(
color:
CupertinoColors
.
white
,
index:
0x000100
),
middle:
const
_ExpectStyles
(
color:
CupertinoColors
.
white
,
index:
0x000100
),
trailing:
CupertinoButton
(
trailing:
CupertinoButton
(
onPressed:
()
{
},
onPressed:
()
{
},
child:
const
_ExpectStyles
(
color:
CupertinoColors
.
activeOrange
,
index:
0x010000
),
child:
_ExpectStyles
(
color:
orange
.
darkColor
,
index:
0x010000
),
),
),
),
),
),
),
...
@@ -1134,7 +1135,7 @@ class _ExpectStyles extends StatelessWidget {
...
@@ -1134,7 +1135,7 @@ class _ExpectStyles extends StatelessWidget {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
final
TextStyle
style
=
DefaultTextStyle
.
of
(
context
).
style
;
final
TextStyle
style
=
DefaultTextStyle
.
of
(
context
).
style
;
expect
(
style
.
color
,
color
);
expect
(
style
.
color
.
value
,
color
.
value
);
expect
(
style
.
fontFamily
,
'.SF Pro Text'
);
expect
(
style
.
fontFamily
,
'.SF Pro Text'
);
expect
(
style
.
fontSize
,
17.0
);
expect
(
style
.
fontSize
,
17.0
);
expect
(
style
.
letterSpacing
,
-
0.41
);
expect
(
style
.
letterSpacing
,
-
0.41
);
...
...
packages/flutter/test/cupertino/nav_bar_transition_test.dart
View file @
deb4184f
...
@@ -246,14 +246,14 @@ void main() {
...
@@ -246,14 +246,14 @@ void main() {
// Move animation further a bit.
// Move animation further a bit.
await
tester
.
pump
(
const
Duration
(
milliseconds:
200
));
await
tester
.
pump
(
const
Duration
(
milliseconds:
200
));
expect
(
bottomMiddle
.
text
.
style
.
color
,
const
Color
(
0xffffa
01a
));
expect
(
bottomMiddle
.
text
.
style
.
color
,
const
Color
(
0xffffa
923
));
expect
(
bottomMiddle
.
text
.
style
.
fontWeight
,
FontWeight
.
w400
);
expect
(
bottomMiddle
.
text
.
style
.
fontWeight
,
FontWeight
.
w400
);
expect
(
bottomMiddle
.
text
.
style
.
fontFamily
,
'.SF Pro Text'
);
expect
(
bottomMiddle
.
text
.
style
.
fontFamily
,
'.SF Pro Text'
);
expect
(
bottomMiddle
.
text
.
style
.
letterSpacing
,
-
0.41
);
expect
(
bottomMiddle
.
text
.
style
.
letterSpacing
,
-
0.41
);
checkOpacity
(
tester
,
flying
(
tester
,
find
.
text
(
'Page 1'
)).
first
,
0.0
);
checkOpacity
(
tester
,
flying
(
tester
,
find
.
text
(
'Page 1'
)).
first
,
0.0
);
expect
(
topBackLabel
.
text
.
style
.
color
,
const
Color
(
0xffffa
01a
));
expect
(
topBackLabel
.
text
.
style
.
color
,
const
Color
(
0xffffa
923
));
expect
(
topBackLabel
.
text
.
style
.
fontWeight
,
FontWeight
.
w400
);
expect
(
topBackLabel
.
text
.
style
.
fontWeight
,
FontWeight
.
w400
);
expect
(
topBackLabel
.
text
.
style
.
fontFamily
,
'.SF Pro Text'
);
expect
(
topBackLabel
.
text
.
style
.
fontFamily
,
'.SF Pro Text'
);
expect
(
topBackLabel
.
text
.
style
.
letterSpacing
,
-
0.41
);
expect
(
topBackLabel
.
text
.
style
.
letterSpacing
,
-
0.41
);
...
...
packages/flutter/test/cupertino/segmented_control_test.dart
View file @
deb4184f
...
@@ -335,7 +335,7 @@ void main() {
...
@@ -335,7 +335,7 @@ void main() {
IconThemeData
iconTheme
=
IconTheme
.
of
(
tester
.
element
(
find
.
byIcon
(
const
IconData
(
1
))));
IconThemeData
iconTheme
=
IconTheme
.
of
(
tester
.
element
(
find
.
byIcon
(
const
IconData
(
1
))));
expect
(
textStyle
.
style
.
color
,
CupertinoColors
.
black
);
expect
(
textStyle
.
style
.
color
,
CupertinoColors
.
black
);
expect
(
iconTheme
.
color
,
CupertinoColors
.
activeOrang
e
);
expect
(
iconTheme
.
color
.
value
,
CupertinoColors
.
activeOrange
.
darkColor
.
valu
e
);
await
tester
.
tap
(
find
.
byIcon
(
const
IconData
(
1
)));
await
tester
.
tap
(
find
.
byIcon
(
const
IconData
(
1
)));
await
tester
.
pump
();
await
tester
.
pump
();
...
@@ -344,7 +344,7 @@ void main() {
...
@@ -344,7 +344,7 @@ void main() {
textStyle
=
tester
.
widget
(
find
.
widgetWithText
(
DefaultTextStyle
,
'Child 1'
).
first
);
textStyle
=
tester
.
widget
(
find
.
widgetWithText
(
DefaultTextStyle
,
'Child 1'
).
first
);
iconTheme
=
IconTheme
.
of
(
tester
.
element
(
find
.
byIcon
(
const
IconData
(
1
))));
iconTheme
=
IconTheme
.
of
(
tester
.
element
(
find
.
byIcon
(
const
IconData
(
1
))));
expect
(
textStyle
.
style
.
color
,
CupertinoColors
.
activeOrang
e
);
expect
(
textStyle
.
style
.
color
.
value
,
CupertinoColors
.
activeOrange
.
darkColor
.
valu
e
);
expect
(
iconTheme
.
color
,
CupertinoColors
.
black
);
expect
(
iconTheme
.
color
,
CupertinoColors
.
black
);
},
},
);
);
...
...
packages/flutter/test/cupertino/slider_test.dart
View file @
deb4184f
...
@@ -412,7 +412,7 @@ void main() {
...
@@ -412,7 +412,7 @@ void main() {
expect
(
expect
(
find
.
byType
(
CupertinoSlider
),
find
.
byType
(
CupertinoSlider
),
// First line it paints is blue.
// First line it paints is blue.
paints
..
rrect
(
color:
CupertinoColors
.
activeBlue
),
paints
..
rrect
(
color:
CupertinoColors
.
systemBlue
.
color
),
);
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -426,9 +426,11 @@ void main() {
...
@@ -426,9 +426,11 @@ void main() {
),
),
),
),
);
);
const
CupertinoDynamicColor
orange
=
CupertinoColors
.
activeOrange
;
expect
(
expect
(
find
.
byType
(
CupertinoSlider
),
find
.
byType
(
CupertinoSlider
),
paints
..
rrect
(
color:
CupertinoColors
.
activeOrange
),
paints
..
rrect
(
color:
orange
.
darkColor
),
);
);
});
});
...
@@ -447,7 +449,7 @@ void main() {
...
@@ -447,7 +449,7 @@ void main() {
);
);
expect
(
expect
(
find
.
byType
(
CupertinoSlider
),
find
.
byType
(
CupertinoSlider
),
paints
..
rrect
(
color:
CupertinoColors
.
activeGreen
),
paints
..
rrect
(
color:
CupertinoColors
.
systemGreen
.
darkColor
),
);
);
});
});
...
...
packages/flutter/test/cupertino/tab_scaffold_test.dart
View file @
deb4184f
...
@@ -378,7 +378,7 @@ void main() {
...
@@ -378,7 +378,7 @@ void main() {
of:
find
.
text
(
'Tab 2'
),
of:
find
.
text
(
'Tab 2'
),
matching:
find
.
byType
(
RichText
),
matching:
find
.
byType
(
RichText
),
));
));
expect
(
tab2
.
text
.
style
.
color
,
CupertinoColors
.
destructiveRed
);
expect
(
tab2
.
text
.
style
.
color
.
value
,
CupertinoColors
.
systemRed
.
darkColor
.
value
);
});
});
testWidgets
(
'Tab contents are padded when there are view insets'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tab contents are padded when there are view insets'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/cupertino/text_field_test.dart
View file @
deb4184f
...
@@ -2807,7 +2807,7 @@ void main() {
...
@@ -2807,7 +2807,7 @@ void main() {
tester
.
firstState
(
find
.
byType
(
EditableText
));
tester
.
firstState
(
find
.
byType
(
EditableText
));
final
RenderEditable
renderEditable
=
editableTextState
.
renderEditable
;
final
RenderEditable
renderEditable
=
editableTextState
.
renderEditable
;
expect
(
renderEditable
.
cursorColor
,
CupertinoColors
.
activeBlue
);
expect
(
renderEditable
.
cursorColor
,
CupertinoColors
.
activeBlue
.
color
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
const
CupertinoApp
(
const
CupertinoApp
(
...
@@ -2819,7 +2819,7 @@ void main() {
...
@@ -2819,7 +2819,7 @@ void main() {
);
);
await
tester
.
pump
();
await
tester
.
pump
();
expect
(
renderEditable
.
cursorColor
,
CupertinoColors
.
activeOrange
);
expect
(
renderEditable
.
cursorColor
,
CupertinoColors
.
activeOrange
.
darkColor
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
const
CupertinoApp
(
const
CupertinoApp
(
...
...
packages/flutter/test/cupertino/theme_test.dart
View file @
deb4184f
...
@@ -129,10 +129,10 @@ void main() {
...
@@ -129,10 +129,10 @@ void main() {
));
));
expect
(
theme
.
brightness
,
Brightness
.
dark
);
expect
(
theme
.
brightness
,
Brightness
.
dark
);
expect
(
theme
.
primaryColor
,
CupertinoColors
.
activeGreen
);
expect
(
theme
.
primaryColor
.
value
,
CupertinoColors
.
systemGreen
.
darkColor
.
value
);
// Now check calculated derivatives.
// Now check calculated derivatives.
expect
(
theme
.
textTheme
.
actionTextStyle
.
color
,
CupertinoColors
.
activeGreen
);
expect
(
theme
.
textTheme
.
actionTextStyle
.
color
.
value
,
CupertinoColors
.
systemGreen
.
darkColor
.
value
);
expect
(
theme
.
scaffoldBackgroundColor
,
CupertinoColors
.
black
);
expect
(
theme
.
scaffoldBackgroundColor
.
value
,
CupertinoColors
.
black
.
value
);
},
},
);
);
...
...
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