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
f2ffc8de
Unverified
Commit
f2ffc8de
authored
Mar 22, 2018
by
Ian Hickson
Committed by
GitHub
Mar 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix RTL icons (#15095)
parent
feadfd2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
icons_demo.dart
examples/flutter_gallery/lib/demo/material/icons_demo.dart
+14
-14
icon.dart
packages/flutter/lib/src/widgets/icon.dart
+1
-1
No files found.
examples/flutter_gallery/lib/demo/material/icons_demo.dart
View file @
f2ffc8de
...
@@ -52,16 +52,16 @@ class IconsDemoState extends State<IconsDemo> {
...
@@ -52,16 +52,16 @@ class IconsDemoState extends State<IconsDemo> {
),
),
body:
new
IconTheme
(
body:
new
IconTheme
(
data:
new
IconThemeData
(
color:
iconColor
),
data:
new
IconThemeData
(
color:
iconColor
),
child:
new
Padding
(
child:
new
SafeArea
(
padding:
const
EdgeInsets
.
all
(
24.0
)
,
top:
false
,
child:
new
SafeArea
(
bottom:
false
,
top:
false
,
child:
new
ListView
(
bottom:
false
,
padding:
const
EdgeInsets
.
all
(
24.0
)
,
child
:
new
Column
(
child
ren:
<
Widget
>[
children:
<
Widget
>[
new
_IconsDemoCard
(
handleIconButtonPress
,
Icons
.
face
),
// direction-agnostic icon
new
_IconsDemoCard
(
handleIconButtonPress
),
const
SizedBox
(
height:
24.0
),
],
new
_IconsDemoCard
(
handleIconButtonPress
,
Icons
.
battery_unknown
),
// direction-aware icon
)
,
]
,
),
),
),
),
),
),
...
@@ -70,10 +70,10 @@ class IconsDemoState extends State<IconsDemo> {
...
@@ -70,10 +70,10 @@ class IconsDemoState extends State<IconsDemo> {
}
}
class
_IconsDemoCard
extends
StatelessWidget
{
class
_IconsDemoCard
extends
StatelessWidget
{
const
_IconsDemoCard
(
this
.
handleIconButtonPress
,
this
.
icon
);
const
_IconsDemoCard
(
this
.
handleIconButtonPress
);
final
VoidCallback
handleIconButtonPress
;
final
VoidCallback
handleIconButtonPress
;
final
IconData
icon
;
Widget
_buildIconButton
(
double
iconSize
,
IconData
icon
,
bool
enabled
)
{
Widget
_buildIconButton
(
double
iconSize
,
IconData
icon
,
bool
enabled
)
{
return
new
IconButton
(
return
new
IconButton
(
...
@@ -95,8 +95,8 @@ class _IconsDemoCard extends StatelessWidget {
...
@@ -95,8 +95,8 @@ class _IconsDemoCard extends StatelessWidget {
return
new
TableRow
(
return
new
TableRow
(
children:
<
Widget
>
[
children:
<
Widget
>
[
_centeredText
(
size
.
floor
().
toString
()),
_centeredText
(
size
.
floor
().
toString
()),
_buildIconButton
(
size
,
Icons
.
face
,
true
),
_buildIconButton
(
size
,
icon
,
true
),
_buildIconButton
(
size
,
Icons
.
face
,
false
),
_buildIconButton
(
size
,
icon
,
false
),
],
],
);
);
}
}
...
...
packages/flutter/lib/src/widgets/icon.dart
View file @
f2ffc8de
...
@@ -151,7 +151,7 @@ class Icon extends StatelessWidget {
...
@@ -151,7 +151,7 @@ class Icon extends StatelessWidget {
switch
(
textDirection
)
{
switch
(
textDirection
)
{
case
TextDirection
.
rtl
:
case
TextDirection
.
rtl
:
iconWidget
=
new
Transform
(
iconWidget
=
new
Transform
(
transform:
new
Matrix4
.
identity
()..
scale
(-
1.0
),
transform:
new
Matrix4
.
identity
()..
scale
(-
1.0
,
1.0
,
1.0
),
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
transformHitTests:
false
,
transformHitTests:
false
,
child:
iconWidget
,
child:
iconWidget
,
...
...
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