Remove 1745 decorative breaks (#123259)

Remove 1745 decorative breaks
This commit is contained in:
Michael Goderbauer
2023-03-22 14:12:22 -07:00
committed by GitHub
parent 14a15dedbe
commit fda9ecfef7
291 changed files with 2 additions and 1749 deletions

View File

@@ -49,17 +49,14 @@ class Context {
switch (subCommand) {
case 'build':
buildApp();
break;
case 'thin':
// No-op, thinning is handled during the bundle asset assemble build target.
break;
case 'embed':
embedFlutterFrameworks();
break;
case 'embed_and_thin':
// Thinning is handled during the bundle asset assemble build target, so just embed.
embedFlutterFrameworks();
break;
case 'test_vm_service_bonjour_service':
// Exposed for integration testing only.
addVmServiceBonjourService();

View File

@@ -552,16 +552,12 @@ class AndroidDevice extends Device {
switch (devicePlatform) {
case TargetPlatform.android_arm:
androidArch = AndroidArch.armeabi_v7a;
break;
case TargetPlatform.android_arm64:
androidArch = AndroidArch.arm64_v8a;
break;
case TargetPlatform.android_x64:
androidArch = AndroidArch.x86_64;
break;
case TargetPlatform.android_x86:
androidArch = AndroidArch.x86;
break;
case TargetPlatform.android:
case TargetPlatform.darwin:
case TargetPlatform.fuchsia_arm64:
@@ -949,25 +945,18 @@ AndroidMemoryInfo parseMeminfoDump(String input) {
switch (key) {
case AndroidMemoryInfo._kJavaHeapKey:
androidMemoryInfo.javaHeap = value;
break;
case AndroidMemoryInfo._kNativeHeapKey:
androidMemoryInfo.nativeHeap = value;
break;
case AndroidMemoryInfo._kCodeKey:
androidMemoryInfo.code = value;
break;
case AndroidMemoryInfo._kStackKey:
androidMemoryInfo.stack = value;
break;
case AndroidMemoryInfo._kGraphicsKey:
androidMemoryInfo.graphics = value;
break;
case AndroidMemoryInfo._kPrivateOtherKey:
androidMemoryInfo.privateOther = value;
break;
case AndroidMemoryInfo._kSystemKey:
androidMemoryInfo.system = value;
break;
}
});
return androidMemoryInfo;

View File

@@ -316,7 +316,6 @@ class AndroidLicenseValidator extends DoctorValidator {
switch (await licensesAccepted) {
case LicensesAccepted.all:
messages.add(ValidationMessage(_userMessages.androidLicensesAll));
break;
case LicensesAccepted.some:
messages.add(ValidationMessage.hint(_userMessages.androidLicensesSome));
return ValidationResult(ValidationType.partial, messages, statusInfo: sdkVersionText);

View File

@@ -327,7 +327,6 @@ class ApkManifestData {
case 'A':
currentElement
.addChild(_Attribute.fromLine(line, currentElement));
break;
case 'E':
final _Element element = _Element.fromLine(line, currentElement);
currentElement.addChild(element);

View File

@@ -743,7 +743,6 @@ void _handlePosixException(Exception e, String? message, int errorCode, String?
'$message. The target device is full.'
'\n$e\n'
'Free up space and try again.';
break;
case eperm:
case eacces:
final StringBuffer errorBuffer = StringBuffer();
@@ -758,7 +757,6 @@ void _handlePosixException(Exception e, String? message, int errorCode, String?
errorBuffer.writeln(posixPermissionSuggestion);
}
errorMessage = errorBuffer.toString();
break;
default:
// Caller must rethrow the exception.
break;
@@ -799,31 +797,26 @@ void _handleWindowsException(Exception e, String? message, int errorCode) {
'$message. The flutter tool cannot access the file or directory.\n'
'Please ensure that the SDK and/or project is installed in a location '
'that has read/write permissions for the current user.';
break;
case kDeviceFull:
errorMessage =
'$message. The target device is full.'
'\n$e\n'
'Free up space and try again.';
break;
case kUserMappedSectionOpened:
errorMessage =
'$message. The file is being used by another program.'
'\n$e\n'
'Do you have an antivirus program running? '
'Try disabling your antivirus program and try again.';
break;
case kFatalDeviceHardwareError:
errorMessage =
'$message. There is a problem with the device driver '
'that this file or directory is stored on.';
break;
case kDeviceDoesNotExist:
errorMessage =
'$message. The device was not found.'
'\n$e\n'
'Verify the device is mounted and try again.';
break;
default:
// Caller must rethrow the exception.
break;

View File

@@ -1065,19 +1065,15 @@ class VerboseLogger extends DelegatingLogger {
if (stackTrace != null) {
super.printError(indent + stackTrace.toString().replaceAll('\n', '\n$indent'));
}
break;
case _LogType.warning:
super.printWarning(prefix + terminal.bolden(indentMessage));
break;
case _LogType.status:
super.printStatus(prefix + terminal.bolden(indentMessage));
break;
case _LogType.trace:
// This seems wrong, since there is a 'printTrace' to call on the
// superclass, but it's actually the entire point of this logger: to
// make things more verbose than they normally would be.
super.printStatus(prefix + indentMessage);
break;
}
}

View File

@@ -191,12 +191,10 @@ class FileStore {
for (final File file in files) {
_hashFile(file, dirty);
}
break;
case FileStoreStrategy.timestamp:
for (final File file in files) {
_checkModification(file, dirty);
}
break;
}
return dirty;
}

View File

@@ -101,24 +101,19 @@ class SourceVisitor implements ResolvedFiles {
case Environment.kProjectDirectory:
segments.addAll(
environment.fileSystem.path.split(environment.projectDir.resolveSymbolicLinksSync()));
break;
case Environment.kBuildDirectory:
segments.addAll(environment.fileSystem.path.split(
environment.buildDir.resolveSymbolicLinksSync()));
break;
case Environment.kCacheDirectory:
segments.addAll(
environment.fileSystem.path.split(environment.cacheDir.resolveSymbolicLinksSync()));
break;
case Environment.kFlutterRootDirectory:
// flutter root will not contain a symbolic link.
segments.addAll(
environment.fileSystem.path.split(environment.flutterRootDir.absolute.path));
break;
case Environment.kOutputDirectory:
segments.addAll(
environment.fileSystem.path.split(environment.outputDir.resolveSymbolicLinksSync()));
break;
default:
throw InvalidPatternException(pattern);
}

View File

@@ -129,7 +129,6 @@ Future<Depfile> copyAssets(
outputPath: file.path,
relativePath: entry.key,
);
break;
case AssetKind.shader:
doCopy = !await shaderCompiler.compileShader(
input: content.file as File,
@@ -137,13 +136,11 @@ Future<Depfile> copyAssets(
target: shaderTarget,
json: targetPlatform == TargetPlatform.web_javascript,
);
break;
case AssetKind.model:
doCopy = !await sceneImporter.importScene(
input: content.file as File,
outputPath: file.path,
);
break;
}
if (doCopy) {
await (content.file as File).copy(file.path);

View File

@@ -196,7 +196,6 @@ class KernelSnapshot extends Target {
case TargetPlatform.windows_x64:
case TargetPlatform.linux_x64:
forceLinkPlatform = true;
break;
case TargetPlatform.android:
case TargetPlatform.android_arm:
case TargetPlatform.android_arm64:
@@ -209,7 +208,6 @@ class KernelSnapshot extends Target {
case TargetPlatform.tester:
case TargetPlatform.web_javascript:
forceLinkPlatform = false;
break;
}
final PackageConfig packageConfig = await loadPackageConfigWithLogging(

View File

@@ -56,7 +56,6 @@ class DevelopmentShaderCompiler {
switch (platform) {
case TargetPlatform.ios:
_shaderTarget = ShaderTarget.impelleriOS;
break;
case TargetPlatform.android_arm64:
case TargetPlatform.android_x64:
case TargetPlatform.android_x86:
@@ -65,7 +64,6 @@ class DevelopmentShaderCompiler {
_shaderTarget = impellerStatus == ImpellerStatus.enabled
? ShaderTarget.impellerAndroid
: ShaderTarget.sksl;
break;
case TargetPlatform.darwin:
case TargetPlatform.linux_x64:
case TargetPlatform.linux_arm64:
@@ -75,12 +73,10 @@ class DevelopmentShaderCompiler {
case TargetPlatform.tester:
assert(impellerStatus != ImpellerStatus.enabled);
_shaderTarget = ShaderTarget.sksl;
break;
case TargetPlatform.web_javascript:
assert(impellerStatus != ImpellerStatus.enabled);
_shaderTarget = ShaderTarget.sksl;
_jsonMode = true;
break;
case null:
return;
}

View File

@@ -194,13 +194,11 @@ Future<void> writeBundle(
target: ShaderTarget.sksl, // TODO(zanderso): configure impeller target when enabled.
json: targetPlatform == TargetPlatform.web_javascript,
);
break;
case AssetKind.model:
doCopy = !await sceneImporter.importScene(
input: input,
outputPath: file.path,
);
break;
}
if (doCopy) {
input.copySync(file.path);

View File

@@ -100,18 +100,15 @@ class BuildBundleCommand extends BuildSubCommand {
if (!featureFlags.isMacOSEnabled) {
throwToolExit('macOS is not a supported target platform.');
}
break;
case TargetPlatform.windows_x64:
if (!featureFlags.isWindowsEnabled) {
throwToolExit('Windows is not a supported target platform.');
}
break;
case TargetPlatform.linux_x64:
case TargetPlatform.linux_arm64:
if (!featureFlags.isLinuxEnabled) {
throwToolExit('Linux is not a supported target platform.');
}
break;
case TargetPlatform.android:
case TargetPlatform.android_arm:
case TargetPlatform.android_arm64:

View File

@@ -356,7 +356,6 @@ class CreateCommand extends CreateBase {
projectType: template,
);
pubContext = PubContext.create;
break;
case FlutterProjectType.skeleton:
generatedFileCount += await generateApp(
<String>['skeleton'],
@@ -367,7 +366,6 @@ class CreateCommand extends CreateBase {
generateMetadata: false,
);
pubContext = PubContext.create;
break;
case FlutterProjectType.module:
generatedFileCount += await _generateModule(
relativeDir,
@@ -376,7 +374,6 @@ class CreateCommand extends CreateBase {
printStatusWhenWriting: !creatingNewProject,
);
pubContext = PubContext.create;
break;
case FlutterProjectType.package:
generatedFileCount += await _generatePackage(
relativeDir,
@@ -385,7 +382,6 @@ class CreateCommand extends CreateBase {
printStatusWhenWriting: !creatingNewProject,
);
pubContext = PubContext.createPackage;
break;
case FlutterProjectType.plugin:
generatedFileCount += await _generateMethodChannelPlugin(
relativeDir,
@@ -395,7 +391,6 @@ class CreateCommand extends CreateBase {
projectType: template,
);
pubContext = PubContext.createPlugin;
break;
case FlutterProjectType.ffiPlugin:
generatedFileCount += await _generateFfiPlugin(
relativeDir,
@@ -405,7 +400,6 @@ class CreateCommand extends CreateBase {
projectType: template,
);
pubContext = PubContext.createPlugin;
break;
}
if (boolArg('pub')) {

View File

@@ -83,7 +83,6 @@ class ScreenshotCommand extends FlutterCommand {
if (!device!.supportsScreenshot) {
throwToolExit('Screenshot not supported for ${device!.name}.');
}
break;
default:
if (vmServiceUrl == null) {
throwToolExit('VM Service URI must be specified for screenshot type $screenshotType');
@@ -111,13 +110,10 @@ class ScreenshotCommand extends FlutterCommand {
switch (stringArg(_kType)) {
case _kDeviceType:
await runScreenshot(outputFile);
break;
case _kSkiaType:
success = await runSkia(outputFile);
break;
case _kRasterizerType:
success = await runRasterizer(outputFile);
break;
}
return success ? FlutterCommandResult.success()

View File

@@ -954,7 +954,6 @@ class PubspecYaml {
endOfDirectDependencies = output.length;
}
endOfDevDependencies = output.length;
break;
case Section.builders:
case Section.dependencyOverrides:
case Section.header:
@@ -964,7 +963,6 @@ class PubspecYaml {
if (data.lockLine != null) {
output.add(data.lockLine!);
}
break;
}
} else {
// Not a header, not a dependency, just pass that through unmodified.
@@ -1377,12 +1375,10 @@ class PubspecDependency extends PubspecLine {
case DependencyKind.unknown:
case DependencyKind.overridden:
assert(kind != DependencyKind.unknown);
break;
case DependencyKind.normal:
if (!kManuallyPinnedDependencies.containsKey(name)) {
dependencies.writeln(' $name: $versionToUse');
}
break;
case DependencyKind.path:
if (_lockIsOverride) {
dependencies.writeln(' $name: $versionToUse');
@@ -1392,7 +1388,6 @@ class PubspecDependency extends PubspecLine {
dependencies.writeln(' $name:');
dependencies.writeln(' path: $_lockTarget');
}
break;
case DependencyKind.sdk:
if (_lockIsOverride) {
dependencies.writeln(' $name: $versionToUse');
@@ -1402,7 +1397,6 @@ class PubspecDependency extends PubspecLine {
dependencies.writeln(' $name:');
dependencies.writeln(' sdk: $_lockTarget');
}
break;
case DependencyKind.git:
if (_lockIsOverride) {
dependencies.writeln(' $name: $versionToUse');
@@ -1412,7 +1406,6 @@ class PubspecDependency extends PubspecLine {
dependencies.writeln(' $name:');
dependencies.writeln(lockLine);
}
break;
}
}

View File

@@ -102,17 +102,13 @@ class ValidateProject {
switch(result.status) {
case StatusProjectValidator.error:
icon = '[✗]';
break;
case StatusProjectValidator.info:
case StatusProjectValidator.success:
icon = '[✓]';
break;
case StatusProjectValidator.warning:
icon = '[!]';
break;
case StatusProjectValidator.crash:
icon = '[☠]';
break;
}
return '$icon $result';

View File

@@ -144,10 +144,8 @@ class StdoutHandler {
switch (message[0]) {
case '+':
sources.add(Uri.parse(message.substring(1)));
break;
case '-':
sources.remove(Uri.parse(message.substring(1)));
break;
default:
_logger.printTrace('Unexpected prefix for $message uri - ignoring');
}

View File

@@ -173,14 +173,12 @@ class FlutterDebugAdapter extends FlutterBaseDebugAdapter {
final bool isFullRestart = request.command == 'hotRestart';
await _performRestart(isFullRestart, args?.args['reason'] as String?);
sendResponse(null);
break;
// Handle requests (from the client) that provide responses to reverse-requests
// that we forwarded from `flutter run --machine`.
case 'flutter.sendForwardedRequestResponse':
_handleForwardedResponse(args);
sendResponse(null);
break;
default:
await super.customRequest(request, args, sendResponse);
@@ -196,12 +194,9 @@ class FlutterDebugAdapter extends FlutterBaseDebugAdapter {
switch (event.extensionKind) {
case 'Flutter.ServiceExtensionStateChanged':
_sendServiceExtensionStateChanged(event.extensionData);
break;
case 'Flutter.Error':
_handleFlutterErrorEvent(event.extensionData);
break;
}
break;
}
}
@@ -457,16 +452,12 @@ class FlutterDebugAdapter extends FlutterBaseDebugAdapter {
switch (event) {
case 'daemon.connected':
_handleDaemonConnected(params);
break;
case 'app.debugPort':
_handleDebugPort(params);
break;
case 'app.start':
_handleAppStart(params);
break;
case 'app.started':
_handleAppStarted();
break;
}
if (_eventsToForwardToClient.contains(event)) {

View File

@@ -671,7 +671,6 @@ class DevFS {
shaderPathsToEvict.add(archivePath);
}
});
break;
case AssetKind.model:
if (sceneImporter == null) {
break;
@@ -689,7 +688,6 @@ class DevFS {
scenePathsToEvict.add(archivePath);
}
});
break;
case AssetKind.regular:
case AssetKind.font:
case null:

View File

@@ -294,19 +294,14 @@ class Doctor {
case ValidationType.crash:
lineBuffer.write('the doctor check crashed without a result.');
sawACrash = true;
break;
case ValidationType.missing:
lineBuffer.write('is not installed.');
break;
case ValidationType.partial:
lineBuffer.write('is partially installed; more components are available.');
break;
case ValidationType.notAvailable:
lineBuffer.write('is not available.');
break;
case ValidationType.success:
lineBuffer.write('is fully installed.');
break;
}
if (result.statusInfo != null) {
@@ -392,15 +387,12 @@ class Doctor {
case ValidationType.crash:
doctorResult = false;
issues += 1;
break;
case ValidationType.missing:
doctorResult = false;
issues += 1;
break;
case ValidationType.partial:
case ValidationType.notAvailable:
issues += 1;
break;
case ValidationType.success:
break;
}

View File

@@ -120,17 +120,14 @@ class GroupedValidator extends DoctorValidator {
if (mergedType == ValidationType.missing) {
mergedType = ValidationType.partial;
}
break;
case ValidationType.notAvailable:
case ValidationType.partial:
mergedType = ValidationType.partial;
break;
case ValidationType.crash:
case ValidationType.missing:
if (mergedType == ValidationType.success) {
mergedType = ValidationType.partial;
}
break;
}
mergedMessages.addAll(result.messages);
}

View File

@@ -479,7 +479,6 @@ bool _validate(Object? manifest, Logger logger) {
if (kvp.value is! String) {
errors.add('Expected "${kvp.key}" to be a string, but got ${kvp.value}.');
}
break;
case 'flutter':
if (kvp.value == null) {
continue;
@@ -489,7 +488,6 @@ bool _validate(Object? manifest, Logger logger) {
} else {
_validateFlutter(kvp.value as YamlMap?, errors);
}
break;
default:
// additionalProperties are allowed.
break;
@@ -522,7 +520,6 @@ void _validateFlutter(YamlMap? yaml, List<String> errors) {
if (yamlValue is! bool) {
errors.add('Expected "$yamlKey" to be a bool, but got $yamlValue (${yamlValue.runtimeType}).');
}
break;
case 'assets':
if (yamlValue is! YamlList) {
errors.add('Expected "$yamlKey" to be a list, but got $yamlValue (${yamlValue.runtimeType}).');
@@ -533,7 +530,6 @@ void _validateFlutter(YamlMap? yaml, List<String> errors) {
'Expected "$yamlKey" to be a list of strings, but the first element is $yamlValue (${yamlValue.runtimeType}).',
);
}
break;
case 'shaders':
if (yamlValue is! YamlList) {
errors.add('Expected "$yamlKey" to be a list, but got $yamlValue (${yamlValue.runtimeType}).');
@@ -544,7 +540,6 @@ void _validateFlutter(YamlMap? yaml, List<String> errors) {
'Expected "$yamlKey" to be a list of strings, but the first element is $yamlValue (${yamlValue.runtimeType}).',
);
}
break;
case 'models':
if (yamlValue is! YamlList) {
errors.add('Expected "$yamlKey" to be a list, but got $yamlValue (${yamlValue.runtimeType}).');
@@ -555,7 +550,6 @@ void _validateFlutter(YamlMap? yaml, List<String> errors) {
'Expected "$yamlKey" to be a list of strings, but the first element is $yamlValue (${yamlValue.runtimeType}).',
);
}
break;
case 'fonts':
if (yamlValue is! YamlList) {
errors.add('Expected "$yamlKey" to be a list, but got $yamlValue (${yamlValue.runtimeType}).');
@@ -568,7 +562,6 @@ void _validateFlutter(YamlMap? yaml, List<String> errors) {
} else {
_validateFonts(yamlValue, errors);
}
break;
case 'licenses':
if (yamlValue is! YamlList) {
errors.add('Expected "$yamlKey" to be a list of files, but got $yamlValue (${yamlValue.runtimeType})');
@@ -581,7 +574,6 @@ void _validateFlutter(YamlMap? yaml, List<String> errors) {
} else {
_validateListType<String>(yamlValue, errors, '"$yamlKey"', 'files');
}
break;
case 'module':
if (yamlValue is! YamlMap) {
errors.add('Expected "$yamlKey" to be an object, but got $yamlValue (${yamlValue.runtimeType}).');
@@ -597,7 +589,6 @@ void _validateFlutter(YamlMap? yaml, List<String> errors) {
if (yamlValue['iosBundleIdentifier'] != null && yamlValue['iosBundleIdentifier'] is! String) {
errors.add('The "iosBundleIdentifier" section must be a string if set.');
}
break;
case 'plugin':
if (yamlValue is! YamlMap) {
errors.add('Expected "$yamlKey" to be an object, but got $yamlValue (${yamlValue.runtimeType}).');
@@ -605,12 +596,10 @@ void _validateFlutter(YamlMap? yaml, List<String> errors) {
}
final List<String> pluginErrors = Plugin.validatePluginYaml(yamlValue);
errors.addAll(pluginErrors);
break;
case 'generate':
break;
case 'deferred-components':
_validateDeferredComponents(kvp, errors);
break;
default:
errors.add('Unexpected child "$yamlKey" found under "flutter".');
break;
@@ -698,17 +687,14 @@ void _validateFonts(YamlList fonts, List<String> errors) {
if (kvp.value is! String) {
errors.add('Expected font asset ${kvp.value} ((${kvp.value.runtimeType})) to be a string.');
}
break;
case 'weight':
if (!fontWeights.contains(kvp.value)) {
errors.add('Invalid value ${kvp.value} ((${kvp.value.runtimeType})) for font -> weight.');
}
break;
case 'style':
if (kvp.value != 'normal' && kvp.value != 'italic') {
errors.add('Invalid value ${kvp.value} ((${kvp.value.runtimeType})) for font -> style.');
}
break;
default:
errors.add('Unexpected key $fontKey ((${kvp.value.runtimeType})) under font.');
break;

View File

@@ -424,7 +424,6 @@ Future<void> _writeAndroidPluginRegistrant(FlutterProject project, List<Plugin>
);
}
templateContent = _androidPluginRegistryTemplateNewEmbedding;
break;
case AndroidEmbeddingVersion.v1:
globals.printWarning(
'This app is using a deprecated version of the Android embedding.\n'
@@ -444,7 +443,6 @@ Future<void> _writeAndroidPluginRegistrant(FlutterProject project, List<Plugin>
}
}
templateContent = _androidPluginRegistryTemplateOldEmbedding;
break;
}
globals.printTrace('Generating $registryPath');
_renderTemplateToFile(

View File

@@ -683,10 +683,8 @@ _XCResultIssueHandlingResult _handleXCResultIssue({required XCResultIssue issue,
switch (issue.type) {
case XCResultIssueType.error:
logger.printError(issueSummary);
break;
case XCResultIssueType.warning:
logger.printWarning(issueSummary);
break;
}
final String? message = issue.message;

View File

@@ -72,12 +72,10 @@ class LocaleInfo implements Comparable<LocaleInfo> {
case 'CN':
case 'SG':
scriptCode = 'Hans';
break;
case 'TW':
case 'HK':
case 'MO':
scriptCode = 'Hant';
break;
}
break;
}
@@ -202,13 +200,10 @@ void precacheLanguageAndRegionTags() {
switch (type) {
case 'language':
_languages[subtag] = description;
break;
case 'region':
_regions[subtag] = description;
break;
case 'script':
_scripts[subtag] = description;
break;
}
}
}

View File

@@ -308,13 +308,10 @@ class Parser {
switch(tokenStr) {
case 'plural':
matchedType = ST.plural;
break;
case 'select':
matchedType = ST.select;
break;
case 'other':
matchedType = ST.other;
break;
}
tokens.add(Node(matchedType!, startIndex, value: match.group(0)));
startIndex = match.end;
@@ -374,13 +371,10 @@ class Parser {
// Theoretically, we can never get here.
throw L10nException('ICU Syntax Error.');
}
break;
case ST.placeholderExpr:
parseAndConstructNode(ST.placeholderExpr, 0);
break;
case ST.pluralExpr:
parseAndConstructNode(ST.pluralExpr, 0);
break;
case ST.pluralParts:
if (tokens.isNotEmpty && (
tokens[0].type == ST.identifier ||
@@ -392,7 +386,6 @@ class Parser {
} else {
parseAndConstructNode(ST.pluralParts, 1);
}
break;
case ST.pluralPart:
if (tokens.isNotEmpty && tokens[0].type == ST.identifier) {
parseAndConstructNode(ST.pluralPart, 0);
@@ -409,10 +402,8 @@ class Parser {
tokens[0].positionInMessage,
);
}
break;
case ST.selectExpr:
parseAndConstructNode(ST.selectExpr, 0);
break;
case ST.selectParts:
if (tokens.isNotEmpty && (
tokens[0].type == ST.identifier ||
@@ -423,7 +414,6 @@ class Parser {
} else {
parseAndConstructNode(ST.selectParts, 1);
}
break;
case ST.selectPart:
if (tokens.isNotEmpty && tokens[0].type == ST.identifier) {
parseAndConstructNode(ST.selectPart, 0);
@@ -440,7 +430,6 @@ class Parser {
tokens[0].positionInMessage
);
}
break;
// At this point, we are only handling terminal symbols.
// ignore: no_default_cases
default:
@@ -530,7 +519,6 @@ class Parser {
node = node.children[1];
}
syntaxTree.children = children;
break;
// ignore: no_default_cases
default:
node.children.forEach(compress);
@@ -568,7 +556,6 @@ class Parser {
);
}
}
break;
case ST.selectParts:
if (children.every((Node node) => node.children[0].type != ST.other)) {
throw L10nParserException(
@@ -579,7 +566,6 @@ class Parser {
syntaxTree.positionInMessage,
);
}
break;
// ignore: no_default_cases
default:
break;

View File

@@ -198,7 +198,6 @@ class CocoaPods {
'To upgrade $cocoaPodsInstallInstructions\n',
emphasis: true,
);
break;
case CocoaPodsStatus.belowMinimumVersion:
_logger.printWarning(
'Warning: CocoaPods minimum required version $cocoaPodsMinimumVersion or greater not installed. Skipping pod install.\n'
@@ -214,7 +213,6 @@ class CocoaPods {
'To upgrade $cocoaPodsInstallInstructions\n',
emphasis: true,
);
break;
case CocoaPodsStatus.recommended:
break;
}

View File

@@ -480,7 +480,6 @@ class MDnsVmServiceDiscovery {
'under System Preferences > Network > iPhone USB. '
'See https://github.com/flutter/flutter/issues/46698 for details.'
);
break;
case TargetPlatform.android:
case TargetPlatform.android_arm:
case TargetPlatform.android_arm64:
@@ -495,7 +494,6 @@ class MDnsVmServiceDiscovery {
case TargetPlatform.web_javascript:
case TargetPlatform.windows_x64:
_logger.printTrace('No interface with an ipv4 link local address was found.');
break;
}
}

View File

@@ -1394,25 +1394,18 @@ String _describePausedIsolates(int pausedIsolatesFound, String serviceEventKind)
switch (serviceEventKind) {
case vm_service.EventKind.kPauseStart:
message.write('paused (probably due to --start-paused)');
break;
case vm_service.EventKind.kPauseExit:
message.write('paused because ${ plural ? 'they have' : 'it has' } terminated');
break;
case vm_service.EventKind.kPauseBreakpoint:
message.write('paused in the debugger on a breakpoint');
break;
case vm_service.EventKind.kPauseInterrupted:
message.write('paused due in the debugger');
break;
case vm_service.EventKind.kPauseException:
message.write('paused in the debugger after an exception was thrown');
break;
case vm_service.EventKind.kPausePostRequest:
message.write('paused');
break;
case '':
message.write('paused for various reasons');
break;
default:
message.write('paused');
}

View File

@@ -44,7 +44,6 @@ Future<String?> sharedSkSlWriter(Device device, Map<String, Object?>? data, {
case TargetPlatform.android_x64:
case TargetPlatform.android_x86:
targetPlatform = TargetPlatform.android;
break;
case TargetPlatform.android:
case TargetPlatform.darwin:
case TargetPlatform.ios:

View File

@@ -378,10 +378,8 @@ class FlutterWebPlatform extends PlatformPlugin {
switch (extension) {
case '.js':
contentType = 'text/javascript';
break;
case '.wasm':
contentType = 'application/wasm';
break;
default:
final String error = 'Failed to determine Content-Type for "${request.url.path}".';
_logger.printError(error);
@@ -787,12 +785,10 @@ class BrowserManager {
break;
case 'restart':
_onRestartController.add(null);
break;
case 'resume':
if (_pauseCompleter != null) {
_pauseCompleter!.complete();
}
break;
default:
// Unreachable.
assert(false);

View File

@@ -961,11 +961,9 @@ class VersionFreshnessValidator {
switch (remoteVersionStatus) {
case VersionCheckResult.newVersionAvailable:
updateMessage = _newVersionAvailableMessage;
break;
case VersionCheckResult.versionIsCurrent:
case VersionCheckResult.unknown:
updateMessage = versionOutOfDateMessage(frameworkAge);
break;
}
logger.printBox(updateMessage);

View File

@@ -1423,19 +1423,16 @@ TerminalHandler setUpTerminalHandler(List<FakeVmServiceRequest> requests, {
..isRunningDebug = true
..isRunningProfile = false
..isRunningRelease = false;
break;
case BuildMode.profile:
residentRunner
..isRunningDebug = false
..isRunningProfile = true
..isRunningRelease = false;
break;
case BuildMode.release:
residentRunner
..isRunningDebug = false
..isRunningProfile = false
..isRunningRelease = true;
break;
}
return TerminalHandler(
residentRunner,

View File

@@ -52,7 +52,6 @@ String getFlutterRoot() {
switch (platform.script.scheme) {
case 'file':
scriptUri = platform.script;
break;
case 'data':
final RegExp flutterTools = RegExp(r'(file://[^"]*[/\\]flutter_tools[/\\][^"]+\.dart)', multiLine: true);
final Match? match = flutterTools.firstMatch(Uri.decodeFull(platform.script.path));
@@ -60,7 +59,6 @@ String getFlutterRoot() {
throw invalidScript();
}
scriptUri = Uri.parse(match.group(1)!);
break;
default:
throw invalidScript();
}