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
2da969aa
Unverified
Commit
2da969aa
authored
Jun 09, 2021
by
Abhishek Ghaskata
Committed by
GitHub
Jun 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrate update_icons to null safety (#84063)
parent
b768056b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
update_icons.dart
dev/tools/update_icons.dart
+9
-12
No files found.
dev/tools/update_icons.dart
View file @
2da969aa
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
// Regenerates the material icons file.
// See https://github.com/flutter/flutter/wiki/Updating-Material-Design-Fonts-&-Icons
...
...
@@ -332,7 +330,7 @@ class _Icon {
id
=
tokenPair
.
key
;
hexCodepoint
=
tokenPair
.
value
;
if
(
id
.
endsWith
(
'_outlined'
)
&&
id
!=
'insert_chart_outlined'
)
{
if
(
id
.
endsWith
(
'_outlined'
)
&&
id
!=
'insert_chart_outlined'
)
{
shortId
=
_replaceLast
(
id
,
'_outlined'
);
htmlSuffix
=
'-outlined'
;
}
else
if
(
id
.
endsWith
(
'_rounded'
))
{
...
...
@@ -349,7 +347,7 @@ class _Icon {
flutterId
=
id
;
for
(
final
MapEntry
<
String
,
String
>
rewritePair
in
identifierRewrites
.
entries
)
{
if
(
id
.
startsWith
(
rewritePair
.
key
))
{
flutterId
=
id
.
replaceFirst
(
rewritePair
.
key
,
identifierRewrites
[
rewritePair
.
key
]);
flutterId
=
id
.
replaceFirst
(
rewritePair
.
key
,
identifierRewrites
[
rewritePair
.
key
]
!
);
}
}
...
...
@@ -358,14 +356,14 @@ class _Icon {
static
const
List
<
String
>
styleSuffixes
=
<
String
>[
''
,
'_outlined'
,
'_rounded'
,
'_sharp'
];
String
id
;
// e.g. 5g, 5g_outlined, 5g_rounded, 5g_sharp
String
shortId
;
// e.g. 5g
String
flutterId
;
// e.g. five_g, five_g_outlined, five_g_rounded, five_g_sharp
String
name
;
// e.g. five g, five g outlined, five g rounded, five g sharp
String
hexCodepoint
;
// e.g. e547
late
String
id
;
// e.g. 5g, 5g_outlined, 5g_rounded, 5g_sharp
late
String
shortId
;
// e.g. 5g
late
String
flutterId
;
// e.g. five_g, five_g_outlined, five_g_rounded, five_g_sharp
late
String
name
;
// e.g. five g, five g outlined, five g rounded, five g sharp
late
String
hexCodepoint
;
// e.g. e547
// The suffix for the 'material-icons' HTML class.
String
htmlSuffix
;
late
String
htmlSuffix
;
String
get
mirroredInRTL
=>
_iconsMirroredWhenRTL
.
contains
(
shortId
)
?
', matchTextDirection: true'
:
''
;
...
...
@@ -394,9 +392,8 @@ class _Icon {
// Sort a regular icon before its variants.
if
(
shortId
==
b
.
shortId
)
{
return
id
.
length
-
b
.
id
.
length
;
}
else
{
return
flutterId
.
compareTo
(
b
.
flutterId
);
}
return
flutterId
.
compareTo
(
b
.
flutterId
);
}
String
_replaceLast
(
String
string
,
String
toReplace
)
{
...
...
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