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
b2a4ebe3
Unverified
Commit
b2a4ebe3
authored
5 years ago
by
Jonah Williams
Committed by
GitHub
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle single unsupported device (#39541)
parent
6266d5f3
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
device.dart
packages/flutter_tools/lib/src/device.dart
+6
-0
device_test.dart
packages/flutter_tools/test/general.shard/device_test.dart
+11
-0
No files found.
packages/flutter_tools/lib/src/device.dart
View file @
b2a4ebe3
...
...
@@ -190,6 +190,12 @@ class DeviceManager {
if
(
isDeviceSupportedForProject
(
device
,
flutterProject
))
device
];
}
else
if
(
devices
.
length
==
1
&&
!
hasSpecifiedDeviceId
&&
!
isDeviceSupportedForProject
(
devices
.
single
,
flutterProject
))
{
// If there is only a single device but it is not supported, then return
// early.
return
<
Device
>[];
}
// If there are still multiple devices and the user did not specify to run
...
...
This diff is collapsed.
Click to expand it.
packages/flutter_tools/test/general.shard/device_test.dart
View file @
b2a4ebe3
...
...
@@ -87,6 +87,17 @@ void main() {
]);
});
testUsingContext
(
'Removes a single unsupported device'
,
()
async
{
final
List
<
Device
>
devices
=
<
Device
>[
unsupported
,
];
final
DeviceManager
deviceManager
=
TestDeviceManager
(
devices
);
final
List
<
Device
>
filtered
=
await
deviceManager
.
findTargetDevices
(
FlutterProject
.
current
());
expect
(
filtered
,
<
Device
>[]);
});
testUsingContext
(
'Removes web and fuchsia from --all'
,
()
async
{
final
List
<
Device
>
devices
=
<
Device
>[
webDevice
,
...
...
This diff is collapsed.
Click to expand it.
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