in flutter run, throw tool exit when --flavor is provided but is not supported on the target device (#139045)

Fixes https://github.com/flutter/flutter/issues/134197
This commit is contained in:
Andrew Kolos
2024-01-05 13:47:58 -08:00
committed by GitHub
parent 8c11aa030d
commit e90e4888b8
13 changed files with 93 additions and 5 deletions

View File

@@ -119,9 +119,11 @@ class FakeDevice extends Device {
PlatformType type = PlatformType.web,
LaunchResult? launchResult,
this.deviceLogReader,
bool supportsFlavors = false,
}) : _isSupported = isSupported,
_isSupportedForProject = isSupportedForProject,
_launchResult = launchResult ?? LaunchResult.succeeded(),
_supportsFlavors = supportsFlavors,
super(
id,
platformType: type,
@@ -131,6 +133,7 @@ class FakeDevice extends Device {
final bool _isSupported;
final bool _isSupportedForProject;
final bool _supportsFlavors;
final LaunchResult _launchResult;
DeviceLogReader? deviceLogReader;
@@ -174,6 +177,9 @@ class FakeDevice extends Device {
@override
bool isSupported() => _isSupported;
@override
bool get supportsFlavors => _supportsFlavors;
@override
bool isConnected;