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
76815fae
Commit
76815fae
authored
Apr 19, 2018
by
Danny Tuppeny
Committed by
Danny Tuppeny
May 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flatten descriptions from Stream to List
parent
b5a3d26f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
emulators.dart
packages/flutter_tools/lib/src/commands/emulators.dart
+1
-1
emulator.dart
packages/flutter_tools/lib/src/emulator.dart
+9
-7
No files found.
packages/flutter_tools/lib/src/commands/emulators.dart
View file @
76815fae
...
...
@@ -74,7 +74,7 @@ class EmulatorsCommand extends FlutterCommand {
}
else
{
printStatus
(
'
${emulators.length}
available
${pluralize('emulator', emulators.length)}
:
\n
'
);
await
Emulator
.
printEmulators
(
emulators
);
Emulator
.
printEmulators
(
emulators
);
}
}
}
packages/flutter_tools/lib/src/emulator.dart
View file @
76815fae
...
...
@@ -102,9 +102,9 @@ abstract class Emulator {
@override
String
toString
()
=>
name
;
static
Stream
<
String
>
descriptions
(
List
<
Emulator
>
emulators
)
async
*
{
static
List
<
String
>
descriptions
(
List
<
Emulator
>
emulators
)
{
if
(
emulators
.
isEmpty
)
return
;
return
<
String
>[]
;
// Extract emulators information
final
List
<
List
<
String
>>
table
=
<
List
<
String
>>[];
...
...
@@ -125,12 +125,14 @@ abstract class Emulator {
}
// Join columns into lines of text
for
(
List
<
String
>
row
in
table
)
{
yield
indices
.
map
((
int
i
)
=>
row
[
i
].
padRight
(
widths
[
i
])).
join
(
' • '
)
+
' •
${row.last}
'
;
}
return
table
.
map
((
List
<
String
>
row
)
{
return
indices
.
map
((
int
i
)
=>
row
[
i
].
padRight
(
widths
[
i
]))
.
join
(
' • '
)
+
' •
${row.last}
'
;
}).
toList
();
}
static
Future
<
Null
>
printEmulators
(
List
<
Emulator
>
emulators
)
async
{
await
descriptions
(
emulators
).
forEach
(
printStatus
);
static
void
printEmulators
(
List
<
Emulator
>
emulators
)
{
descriptions
(
emulators
).
forEach
(
printStatus
);
}
}
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