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
a51b8e43
Unverified
Commit
a51b8e43
authored
Dec 08, 2020
by
Pierre-Louis
Committed by
GitHub
Dec 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix text direction logic for material icon variants (#71852)
parent
2cb65260
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
225 additions
and
214 deletions
+225
-214
update_icons.dart
dev/tools/update_icons.dart
+1
-2
icons.dart
packages/flutter/lib/src/material/icons.dart
+212
-212
icons_test.dart
packages/flutter/test/material/icons_test.dart
+12
-0
No files found.
dev/tools/update_icons.dart
View file @
a51b8e43
...
...
@@ -383,8 +383,7 @@ class _Icon {
// e.g. e547
String
hexCodepoint
;
// TODO(guidezpl): will be fixed in a future PR to be shortId instead of id
String
get
mirroredInRTL
=>
_iconsMirroredWhenRTL
.
contains
(
id
)
?
', matchTextDirection: true'
:
''
;
String
get
mirroredInRTL
=>
_iconsMirroredWhenRTL
.
contains
(
shortId
)
?
', matchTextDirection: true'
:
''
;
String
get
name
=>
id
.
replaceAll
(
'_'
,
' '
);
...
...
packages/flutter/lib/src/material/icons.dart
View file @
a51b8e43
This diff is collapsed.
Click to expand it.
packages/flutter/test/material/icons_test.dart
View file @
a51b8e43
...
...
@@ -17,6 +17,18 @@ void main() {
expect
(
Icons
.
search
.
fontFamily
,
'MaterialIcons'
);
});
testWidgets
(
'Certain icons (and their variants) match text direction'
,
(
WidgetTester
tester
)
async
{
expect
(
Icons
.
arrow_back
.
matchTextDirection
,
true
);
expect
(
Icons
.
arrow_back_rounded
.
matchTextDirection
,
true
);
expect
(
Icons
.
arrow_back_outlined
.
matchTextDirection
,
true
);
expect
(
Icons
.
arrow_back_sharp
.
matchTextDirection
,
true
);
expect
(
Icons
.
access_time
.
matchTextDirection
,
false
);
expect
(
Icons
.
access_time_rounded
.
matchTextDirection
,
false
);
expect
(
Icons
.
access_time_outlined
.
matchTextDirection
,
false
);
expect
(
Icons
.
access_time_sharp
.
matchTextDirection
,
false
);
});
testWidgets
(
'Adaptive icons are correct on cupertino platforms'
,
(
WidgetTester
tester
)
async
{
expect
(
Icons
.
adaptive
.
arrow_back
,
Icons
.
arrow_back_ios
);
...
...
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