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
a5419341
Commit
a5419341
authored
Jan 08, 2020
by
Alexandre Ardhuin
Committed by
Flutter GitHub Bot
Jan 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable lint prefer_for_elements_to_map_fromIterable (#47726)
parent
d1349f69
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
12 deletions
+8
-12
analysis_options.yaml
analysis_options.yaml
+1
-1
app.dart
examples/flutter_gallery/lib/gallery/app.dart
+3
-5
demos.dart
examples/flutter_gallery/lib/gallery/demos.dart
+4
-6
No files found.
analysis_options.yaml
View file @
a5419341
...
...
@@ -143,7 +143,7 @@ linter:
-
prefer_final_fields
-
prefer_final_in_for_each
-
prefer_final_locals
# - prefer_for_elements_to_map_fromIterable # not yet tested
-
prefer_for_elements_to_map_fromIterable
-
prefer_foreach
# - prefer_function_declarations_over_variables # not yet tested
-
prefer_generic_function_type_aliases
...
...
examples/flutter_gallery/lib/gallery/app.dart
View file @
a5419341
...
...
@@ -51,11 +51,9 @@ class _GalleryAppState extends State<GalleryApp> {
// For a different example of how to set up an application routing table
// using named routes, consider the example in the Navigator class documentation:
// https://docs.flutter.io/flutter/widgets/Navigator-class.html
return
Map
<
String
,
WidgetBuilder
>.
fromIterable
(
kAllGalleryDemos
,
key:
(
dynamic
demo
)
=>
'
${(demo as GalleryDemo).routeName}
'
,
value:
(
dynamic
demo
)
=>
(
demo
as
GalleryDemo
).
buildRoute
,
);
return
<
String
,
WidgetBuilder
>{
for
(
final
GalleryDemo
demo
in
kAllGalleryDemos
)
demo
.
routeName
:
demo
.
buildRoute
,
};
}
@override
...
...
examples/flutter_gallery/lib/gallery/demos.dart
View file @
a5419341
...
...
@@ -579,9 +579,7 @@ final Map<GalleryDemoCategory, List<GalleryDemo>> kGalleryCategoryToDemos =
},
);
final
Map
<
String
,
String
>
kDemoDocumentationUrl
=
Map
<
String
,
String
>.
fromIterable
(
kAllGalleryDemos
.
where
((
GalleryDemo
demo
)
=>
demo
.
documentationUrl
!=
null
),
key:
(
dynamic
demo
)
=>
(
demo
as
GalleryDemo
).
routeName
,
value:
(
dynamic
demo
)
=>
(
demo
as
GalleryDemo
).
documentationUrl
,
);
final
Map
<
String
,
String
>
kDemoDocumentationUrl
=
<
String
,
String
>{
for
(
final
GalleryDemo
demo
in
kAllGalleryDemos
)
if
(
demo
.
documentationUrl
!=
null
)
demo
.
routeName
:
demo
.
documentationUrl
,
};
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