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
4399fea1
Commit
4399fea1
authored
Apr 26, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Icons in material buttons should match text color (#3551)
Fixes #3186
parent
c6942c99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
button.dart
packages/flutter/lib/src/material/button.dart
+20
-12
No files found.
packages/flutter/lib/src/material/button.dart
View file @
4399fea1
...
...
@@ -7,6 +7,8 @@ import 'package:flutter/widgets.dart';
import
'colors.dart'
;
import
'constants.dart'
;
import
'debug.dart'
;
import
'icon_theme_data.dart'
;
import
'icon_theme.dart'
;
import
'ink_well.dart'
;
import
'material.dart'
;
import
'theme.dart'
;
...
...
@@ -168,24 +170,30 @@ abstract class MaterialButtonState<T extends MaterialButton> extends State<T> {
@override
Widget
build
(
BuildContext
context
)
{
assert
(
debugCheckHasMaterial
(
context
));
Widget
contents
=
new
InkWell
(
onTap:
config
.
onPressed
,
onHighlightChanged:
_handleHighlightChanged
,
child:
new
Container
(
padding:
new
EdgeInsets
.
symmetric
(
horizontal:
8.0
),
child:
new
Center
(
widthFactor:
1.0
,
child:
config
.
child
final
Color
textColor
=
_getTextColor
(
context
);
Widget
contents
=
new
IconTheme
(
data:
new
IconThemeData
(
color:
textColor
),
child:
new
InkWell
(
onTap:
config
.
onPressed
,
onHighlightChanged:
_handleHighlightChanged
,
child:
new
Container
(
padding:
new
EdgeInsets
.
symmetric
(
horizontal:
8.0
),
child:
new
Center
(
widthFactor:
1.0
,
child:
config
.
child
)
)
)
);
TextStyle
style
=
Theme
.
of
(
context
).
textTheme
.
button
.
copyWith
(
color:
_getTextColor
(
context
)
);
int
elevation
=
this
.
elevation
;
Color
color
=
getColor
(
context
);
final
TextStyle
style
=
Theme
.
of
(
context
).
textTheme
.
button
.
copyWith
(
color:
textColor
);
final
int
elevation
=
this
.
elevation
;
final
Color
color
=
getColor
(
context
);
if
(
elevation
>
0
||
color
!=
null
)
{
contents
=
new
Material
(
type:
MaterialType
.
button
,
color:
getColor
(
context
)
,
color:
color
,
elevation:
elevation
,
textStyle:
style
,
child:
contents
...
...
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