[flutter_tools] Adds some support for '-d all' (#9585)
diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart index b4e0fbc..7ba2299 100644 --- a/packages/flutter_tools/lib/src/device.dart +++ b/packages/flutter_tools/lib/src/device.dart
@@ -32,11 +32,26 @@ final List<DeviceDiscovery> _deviceDiscoverers = <DeviceDiscovery>[]; - /// A user-specified device ID. - String specifiedDeviceId; + String _specifiedDeviceId; + /// A user-specified device ID. + String get specifiedDeviceId { + if (_specifiedDeviceId == null || _specifiedDeviceId == 'all') + return null; + return _specifiedDeviceId; + } + + set specifiedDeviceId(String id) { + _specifiedDeviceId = id; + } + + /// True when the user has specified a single specific device. bool get hasSpecifiedDeviceId => specifiedDeviceId != null; + /// True when the user has specified all devices by setting + /// specifiedDeviceId = 'all'. + bool get hasSpecifiedAllDevices => _specifiedDeviceId == 'all'; + Stream<Device> getDevicesById(String deviceId) async* { final Stream<Device> devices = getAllConnectedDevices(); deviceId = deviceId.toLowerCase();