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
f864ec26
Commit
f864ec26
authored
Oct 09, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1564 from abarth/fast_white_icons
Make it fast to draw color icons
parents
8915cf0b
ee7c72f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
icon_button.dart
packages/flutter/lib/src/material/icon_button.dart
+17
-12
No files found.
packages/flutter/lib/src/material/icon_button.dart
View file @
f864ec26
...
...
@@ -10,26 +10,31 @@ import 'package:sky/widgets.dart';
import
'icon.dart'
;
class
IconButton
extends
StatelessComponent
{
const
IconButton
({
Key
key
,
this
.
icon
,
this
.
onPressed
,
this
.
color
})
:
super
(
key:
key
);
const
IconButton
({
Key
key
,
this
.
icon
,
this
.
color
,
this
.
colorFilter
,
this
.
onPressed
})
:
super
(
key:
key
);
final
String
icon
;
final
Color
color
;
final
IconThemeColor
color
;
final
sky
.
ColorFilter
colorFilter
;
final
GestureTapCallback
onPressed
;
Widget
build
(
BuildContext
context
)
{
Widget
child
=
new
Icon
(
type:
icon
,
size:
24
);
if
(
color
!=
null
)
{
child
=
new
ColorFilter
(
color:
color
,
transferMode:
sky
.
TransferMode
.
srcATop
,
child:
child
);
}
return
new
GestureDetector
(
onTap:
onPressed
,
child:
new
Padding
(
child:
child
,
padding:
const
EdgeDims
.
all
(
8.0
))
padding:
const
EdgeDims
.
all
(
8.0
),
child:
new
Icon
(
type:
icon
,
size:
24
,
color:
color
,
colorFilter:
colorFilter
)
)
);
}
}
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