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
2ef7cd64
Unverified
Commit
2ef7cd64
authored
Sep 04, 2018
by
Will Larche
Committed by
GitHub
Sep 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Icons] Updating default icon theme values. (#20840)
Closes #3188
parent
70eefd1e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
7 deletions
+27
-7
icon_color_test.dart
examples/stocks/test/icon_color_test.dart
+1
-1
button.dart
packages/flutter/lib/src/material/button.dart
+2
-2
theme_data.dart
packages/flutter/lib/src/material/theme_data.dart
+2
-2
buttons_test.dart
packages/flutter/test/material/buttons_test.dart
+21
-1
expand_icon_test.dart
packages/flutter/test/material/expand_icon_test.dart
+1
-1
No files found.
examples/stocks/test/icon_color_test.dart
View file @
2ef7cd64
...
@@ -74,7 +74,7 @@ void main() {
...
@@ -74,7 +74,7 @@ void main() {
// check the colour of the icon - light mode
// check the colour of the icon - light mode
checkIconColor
(
tester
,
'Stock List'
,
Colors
.
purple
);
// theme primary color
checkIconColor
(
tester
,
'Stock List'
,
Colors
.
purple
);
// theme primary color
checkIconColor
(
tester
,
'Account Balance'
,
Colors
.
black
26
);
// disabled
checkIconColor
(
tester
,
'Account Balance'
,
Colors
.
black
38
);
// disabled
checkIconColor
(
tester
,
'About'
,
Colors
.
black45
);
// enabled
checkIconColor
(
tester
,
'About'
,
Colors
.
black45
);
// enabled
// switch to dark mode
// switch to dark mode
...
...
packages/flutter/lib/src/material/button.dart
View file @
2ef7cd64
...
@@ -411,11 +411,11 @@ class MaterialButton extends StatelessWidget {
...
@@ -411,11 +411,11 @@ class MaterialButton extends StatelessWidget {
case
ButtonTextTheme
.
normal
:
case
ButtonTextTheme
.
normal
:
return
enabled
return
enabled
?
(
themeIsDark
?
Colors
.
white
:
Colors
.
black87
)
?
(
themeIsDark
?
Colors
.
white
:
Colors
.
black87
)
:
(
themeIsDark
?
Colors
.
white30
:
Colors
.
black26
)
;
:
theme
.
disabledColor
;
case
ButtonTextTheme
.
accent
:
case
ButtonTextTheme
.
accent
:
return
enabled
return
enabled
?
theme
.
accentColor
?
theme
.
accentColor
:
(
themeIsDark
?
Colors
.
white30
:
Colors
.
black26
)
;
:
theme
.
disabledColor
;
case
ButtonTextTheme
.
primary
:
case
ButtonTextTheme
.
primary
:
return
enabled
return
enabled
?
(
fillIsDark
?
Colors
.
white
:
Colors
.
black
)
?
(
fillIsDark
?
Colors
.
white
:
Colors
.
black
)
...
...
packages/flutter/lib/src/material/theme_data.dart
View file @
2ef7cd64
...
@@ -167,7 +167,7 @@ class ThemeData extends Diagnosticable {
...
@@ -167,7 +167,7 @@ class ThemeData extends Diagnosticable {
splashFactory
??=
InkSplash
.
splashFactory
;
splashFactory
??=
InkSplash
.
splashFactory
;
selectedRowColor
??=
Colors
.
grey
[
100
];
selectedRowColor
??=
Colors
.
grey
[
100
];
unselectedWidgetColor
??=
isDark
?
Colors
.
white70
:
Colors
.
black54
;
unselectedWidgetColor
??=
isDark
?
Colors
.
white70
:
Colors
.
black54
;
disabledColor
??=
isDark
?
Colors
.
white30
:
Colors
.
black
26
;
disabledColor
??=
isDark
?
Colors
.
white30
:
Colors
.
black
38
;
buttonColor
??=
isDark
?
primarySwatch
[
600
]
:
Colors
.
grey
[
300
];
buttonColor
??=
isDark
?
primarySwatch
[
600
]
:
Colors
.
grey
[
300
];
buttonTheme
??=
const
ButtonThemeData
();
buttonTheme
??=
const
ButtonThemeData
();
// Spec doesn't specify a dark theme secondaryHeaderColor, this is a guess.
// Spec doesn't specify a dark theme secondaryHeaderColor, this is a guess.
...
@@ -182,9 +182,9 @@ class ThemeData extends Diagnosticable {
...
@@ -182,9 +182,9 @@ class ThemeData extends Diagnosticable {
hintColor
??=
isDark
?
const
Color
(
0x80FFFFFF
)
:
const
Color
(
0x8A000000
);
hintColor
??=
isDark
?
const
Color
(
0x80FFFFFF
)
:
const
Color
(
0x8A000000
);
errorColor
??=
Colors
.
red
[
700
];
errorColor
??=
Colors
.
red
[
700
];
inputDecorationTheme
??=
const
InputDecorationTheme
();
inputDecorationTheme
??=
const
InputDecorationTheme
();
iconTheme
??=
isDark
?
const
IconThemeData
(
color:
Colors
.
white
)
:
const
IconThemeData
(
color:
Colors
.
black
);
primaryIconTheme
??=
primaryIsDark
?
const
IconThemeData
(
color:
Colors
.
white
)
:
const
IconThemeData
(
color:
Colors
.
black
);
primaryIconTheme
??=
primaryIsDark
?
const
IconThemeData
(
color:
Colors
.
white
)
:
const
IconThemeData
(
color:
Colors
.
black
);
accentIconTheme
??=
accentIsDark
?
const
IconThemeData
(
color:
Colors
.
white
)
:
const
IconThemeData
(
color:
Colors
.
black
);
accentIconTheme
??=
accentIsDark
?
const
IconThemeData
(
color:
Colors
.
white
)
:
const
IconThemeData
(
color:
Colors
.
black
);
iconTheme
??=
isDark
?
const
IconThemeData
(
color:
Colors
.
white
)
:
const
IconThemeData
(
color:
Colors
.
black87
);
platform
??=
defaultTargetPlatform
;
platform
??=
defaultTargetPlatform
;
final
Typography
typography
=
new
Typography
(
platform:
platform
);
final
Typography
typography
=
new
Typography
(
platform:
platform
);
final
TextTheme
defaultTextTheme
=
isDark
?
typography
.
white
:
typography
.
black
;
final
TextTheme
defaultTextTheme
=
isDark
?
typography
.
white
:
typography
.
black
;
...
...
packages/flutter/test/material/buttons_test.dart
View file @
2ef7cd64
...
@@ -310,7 +310,27 @@ void main() {
...
@@ -310,7 +310,27 @@ void main() {
);
);
});
});
testWidgets
(
'Disabled MaterialButton has same semantic size as enabled and exposes disabled semantics'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Disabled MaterialButton has correct default text color'
,
(
WidgetTester
tester
)
async
{
const
String
testText
=
'Disabled'
;
const
Widget
buttonWidget
=
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
MaterialButton
(
onPressed:
null
,
child:
Text
(
testText
),
// button is disabled
),
),
),
);
await
tester
.
pumpWidget
(
buttonWidget
);
final
RichText
text
=
tester
.
widget
<
RichText
>(
find
.
byType
(
RichText
));
expect
(
text
.
text
.
style
.
color
,
Colors
.
black38
);
});
testWidgets
(
'Disabled MaterialButton has same semantic size as enabled and exposes disabled semantics'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
new
SemanticsTester
(
tester
);
final
SemanticsTester
semantics
=
new
SemanticsTester
(
tester
);
final
Rect
expectedButtonSize
=
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
116.0
,
48.0
);
final
Rect
expectedButtonSize
=
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
116.0
,
48.0
);
...
...
packages/flutter/test/material/expand_icon_test.dart
View file @
2ef7cd64
...
@@ -37,7 +37,7 @@ void main() {
...
@@ -37,7 +37,7 @@ void main() {
);
);
final
IconTheme
iconTheme
=
tester
.
firstWidget
(
find
.
byType
(
IconTheme
).
last
);
final
IconTheme
iconTheme
=
tester
.
firstWidget
(
find
.
byType
(
IconTheme
).
last
);
expect
(
iconTheme
.
data
.
color
,
equals
(
Colors
.
black
26
));
expect
(
iconTheme
.
data
.
color
,
equals
(
Colors
.
black
38
));
});
});
testWidgets
(
'ExpandIcon test isExpanded does not trigger callback'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'ExpandIcon test isExpanded does not trigger callback'
,
(
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