[multiple] Avoid new unreachable_switch_default
warning. (flutter/engine#54996)
The Dart analyzer will soon be changed so that if the `default` clause of a `switch` statement is determined to be unreachable by the exhaustiveness checker, a new warning of type `unreachable_switch_default` will be issued. This parallels the behavior of the existing `unreachable_switch_case` warning, which is issued whenever a `case` clause of a `switch` statement is determined to be unreachable. Before adding the new warning to the analyzer, code in the engine needs to first be updated to eliminate these unreachable `default` clauses, so that the warning won't cause builds to break. For more information, see https://github.com/dart-lang/sdk/issues/54575.
This commit is contained in:
parent
adfd4c03de
commit
92e2915b51
@ -266,7 +266,5 @@ CkColorFilter? createCkColorFilter(EngineColorFilter colorFilter) {
|
||||
return const CkLinearToSrgbGammaColorFilter();
|
||||
case ColorFilterType.srgbToLinearGamma:
|
||||
return const CkSrgbToLinearGammaColorFilter();
|
||||
default:
|
||||
throw StateError('Unknown mode $colorFilter.type for ColorFilter.');
|
||||
}
|
||||
}
|
||||
|
@ -844,8 +844,6 @@ class Mutator {
|
||||
return matrix == typedOther.matrix;
|
||||
case MutatorType.opacity:
|
||||
return alpha == typedOther.alpha;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1337,7 +1337,6 @@ String? stringForStrokeCap(ui.StrokeCap? strokeCap) {
|
||||
case ui.StrokeCap.round:
|
||||
return 'round';
|
||||
case ui.StrokeCap.square:
|
||||
default:
|
||||
return 'square';
|
||||
}
|
||||
}
|
||||
@ -1349,7 +1348,6 @@ String stringForStrokeJoin(ui.StrokeJoin strokeJoin) {
|
||||
case ui.StrokeJoin.bevel:
|
||||
return 'bevel';
|
||||
case ui.StrokeJoin.miter:
|
||||
default:
|
||||
return 'miter';
|
||||
}
|
||||
}
|
||||
|
@ -914,7 +914,5 @@ EngineHtmlColorFilter? createHtmlColorFilter(EngineColorFilter? colorFilter) {
|
||||
throw UnimplementedError('ColorFilter.linearToSrgbGamma not implemented for HTML renderer');
|
||||
case ColorFilterType.srgbToLinearGamma:
|
||||
throw UnimplementedError('ColorFilter.srgbToLinearGamma not implemented for HTML renderer.');
|
||||
default:
|
||||
throw StateError('Unknown mode $colorFilter.type for ColorFilter.');
|
||||
}
|
||||
}
|
||||
|
@ -1118,8 +1118,6 @@ String? _decorationStyleToCssString(ui.TextDecorationStyle decorationStyle) {
|
||||
return 'solid';
|
||||
case ui.TextDecorationStyle.wavy:
|
||||
return 'wavy';
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,6 @@ class TextCapitalizationConfig {
|
||||
case TextCapitalization.sentences:
|
||||
autocapitalize = 'sentences';
|
||||
case TextCapitalization.none:
|
||||
default:
|
||||
autocapitalize = 'off';
|
||||
}
|
||||
if (domInstanceOfString(domElement, 'HTMLInputElement')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user