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

@@ -115,7 +115,6 @@ class _FilteredChildAnimationPageState extends State<FilteredChildAnimationPage>
opacity: (_controller.value * 2.0 - 1.0).abs(),
child: child,
);
break;
case FilterType.rotateTransform:
builder = (BuildContext context, Widget? child) => Transform(
transform: Matrix4.rotationZ(_controller.value * 2.0 * pi),
@@ -123,7 +122,6 @@ class _FilteredChildAnimationPageState extends State<FilteredChildAnimationPage>
filterQuality: FilterQuality.low,
child: child,
);
break;
case FilterType.rotateFilter:
builder = (BuildContext context, Widget? child) => ImageFiltered(
imageFilter: ImageFilter.matrix((
@@ -134,7 +132,6 @@ class _FilteredChildAnimationPageState extends State<FilteredChildAnimationPage>
).storage),
child: child,
);
break;
}
return RepaintBoundary(
child: AnimatedBuilder(

View File

@@ -22,14 +22,12 @@ Future<void> main() async {
await Future<void>.delayed(const Duration(seconds: 20));
});
}
break;
case 'TargetPlatform.android':
{
// Just run for 20 seconds to collect memory usage. The widget itself
// animates during this time.
await Future<void>.delayed(const Duration(seconds: 20));
}
break;
default:
throw UnsupportedError('Unsupported platform $targetPlatform');
}

View File

@@ -16,31 +16,22 @@ List<Object?> _makeTestBuffer(int size) {
switch (i % 9) {
case 0:
answer.add(1);
break;
case 1:
answer.add(math.pow(2, 65));
break;
case 2:
answer.add(1234.0);
break;
case 3:
answer.add(null);
break;
case 4:
answer.add(<int>[1234]);
break;
case 5:
answer.add(<String, int>{'hello': 1234});
break;
case 6:
answer.add('this is a test');
break;
case 7:
answer.add(true);
break;
case 8:
answer.add(Uint8List(64));
break;
}
}
return answer;

View File

@@ -94,19 +94,15 @@ class StockHomeState extends State<StockHome> {
setState(() {
_autorefresh = !_autorefresh;
});
break;
case _StockMenuItem.refresh:
showDialog<void>(
context: context,
builder: (BuildContext context) => const _NotImplementedDialog(),
);
break;
case _StockMenuItem.speedUp:
timeDilation /= 5.0;
break;
case _StockMenuItem.speedDown:
timeDilation *= 5.0;
break;
}
}

View File

@@ -63,7 +63,6 @@ class StockSettingsState extends State<StockSettings> {
switch (widget.configuration.stockMode) {
case StockMode.optimistic:
_handleOptimismChanged(false);
break;
case StockMode.pessimistic:
showDialog<bool>(
context: context,
@@ -88,7 +87,6 @@ class StockSettingsState extends State<StockSettings> {
);
},
).then<void>(_handleOptimismChanged);
break;
}
}

View File

@@ -1148,7 +1148,6 @@ Future<void> _runInteractive({
if (!busy) {
rerun();
}
break;
}
});
Watcher(file.absolute.path).events.listen((_) => rerun());

View File

@@ -113,7 +113,6 @@ Future<Command> startCommand(String executable, List<String> arguments, {
switch (outputMode) {
case OutputMode.print:
print(line);
break;
case OutputMode.capture:
break;
}
@@ -127,7 +126,6 @@ Future<Command> startCommand(String executable, List<String> arguments, {
switch (outputMode) {
case OutputMode.print:
print(line);
break;
case OutputMode.capture:
break;
}
@@ -188,7 +186,6 @@ Future<CommandResult> runCommand(String executable, List<String> arguments, {
case OutputMode.capture:
print(result.flattenedStdout);
print(result.flattenedStderr);
break;
}
String allOutput;
if (failureMessage == null) {

View File

@@ -107,25 +107,18 @@ String _testTypeToIndexFile(ServiceWorkerTestType type) {
switch (type) {
case ServiceWorkerTestType.blockedServiceWorkers:
indexFile = 'index_with_blocked_service_workers.html';
break;
case ServiceWorkerTestType.withFlutterJs:
indexFile = 'index_with_flutterjs.html';
break;
case ServiceWorkerTestType.withoutFlutterJs:
indexFile = 'index_without_flutterjs.html';
break;
case ServiceWorkerTestType.withFlutterJsShort:
indexFile = 'index_with_flutterjs_short.html';
break;
case ServiceWorkerTestType.withFlutterJsEntrypointLoadedEvent:
indexFile = 'index_with_flutterjs_entrypoint_loaded.html';
break;
case ServiceWorkerTestType.withFlutterJsTrustedTypesOn:
indexFile = 'index_with_flutterjs_el_tt_on.html';
break;
case ServiceWorkerTestType.generatedEntrypoint:
indexFile = 'generated_entrypoint.html';
break;
}
return indexFile;
}

View File

@@ -160,12 +160,10 @@ String getNewPrLink({
candidateBranch = state.framework.candidateBranch;
workingBranch = state.framework.workingBranch;
repoLabel = 'Framework';
break;
case 'engine':
candidateBranch = state.engine.candidateBranch;
workingBranch = state.engine.workingBranch;
repoLabel = 'Engine';
break;
default:
throw ConductorException('Expected repoName to be one of flutter or engine but got $repoName.');
}

View File

@@ -141,7 +141,6 @@ class NextContext extends Context {
}
await pushWorkingBranch(engine, state.engine);
break;
case pb.ReleasePhase.CODESIGN_ENGINE_BINARIES:
stdio.printStatus(<String>[
'You must validate pre-submit CI for your engine PR, merge it, and codesign',
@@ -158,7 +157,6 @@ class NextContext extends Context {
return;
}
}
break;
case pb.ReleasePhase.APPLY_FRAMEWORK_CHERRYPICKS:
final Remote engineUpstreamRemote = Remote(
name: RemoteName.upstream,
@@ -251,7 +249,6 @@ class NextContext extends Context {
}
await pushWorkingBranch(framework, state.framework);
break;
case pb.ReleasePhase.PUBLISH_VERSION:
stdio.printStatus('Please ensure that you have merged your framework PR and that');
stdio.printStatus('post-submit CI has finished successfully.\n');
@@ -292,7 +289,6 @@ class NextContext extends Context {
}
await framework.tag(frameworkHead, state.releaseVersion, frameworkUpstream.name);
await engine.tag(engineHead, state.releaseVersion, engineUpstream.name);
break;
case pb.ReleasePhase.PUBLISH_CHANNEL:
final Remote upstream = Remote(
name: RemoteName.upstream,
@@ -331,7 +327,6 @@ class NextContext extends Context {
remote: state.framework.upstream.url,
force: force,
);
break;
case pb.ReleasePhase.VERIFY_RELEASE:
stdio.printStatus(
'The current status of packaging builds can be seen at:\n'
@@ -346,7 +341,6 @@ class NextContext extends Context {
return;
}
}
break;
case pb.ReleasePhase.RELEASE_COMPLETED:
throw ConductorException('This release is finished.');
}

View File

@@ -394,16 +394,12 @@ class StartContext extends Context {
z: 0,
type: VersionType.stable,
);
break;
case ReleaseType.STABLE_HOTFIX:
nextVersion = Version.increment(lastVersion, 'z');
break;
case ReleaseType.BETA_INITIAL:
nextVersion = Version.fromCandidateBranch(candidateBranch);
break;
case ReleaseType.BETA_HOTFIX:
nextVersion = Version.increment(lastVersion, 'n');
break;
}
return nextVersion;
}

View File

@@ -54,20 +54,16 @@ class Version {
assert(m == null);
assert(n == null);
assert(commits == null);
break;
case VersionType.development:
assert(m != null);
assert(n != null);
assert(commits == null);
break;
case VersionType.latest:
assert(m != null);
assert(n != null);
assert(commits != null);
break;
case VersionType.gitDescribe:
assert(commits != null);
break;
}
}
@@ -182,19 +178,15 @@ class Version {
nextM = 0;
nextN = 0;
}
break;
case 'z':
// Hotfix to stable release.
assert(previousVersion.type == VersionType.stable);
nextZ += 1;
break;
case 'm':
assert(false, "Do not increment 'm' via Version.increment, use instead Version.fromCandidateBranch()");
break;
case 'n':
// Hotfix to internal roll.
nextN = nextN! + 1;
break;
default:
throw Exception('Unknown increment level $increment.');
}

View File

@@ -114,14 +114,11 @@ class ABTest {
switch (aligns[column]) {
case FieldJustification.LEFT:
value = value.padRight(len);
break;
case FieldJustification.RIGHT:
value = value.padLeft(len);
break;
case FieldJustification.CENTER:
value = value.padLeft((len + value.length) ~/2);
value = value.padRight(len);
break;
}
}
if (column > 0) {

View File

@@ -685,7 +685,6 @@ class StartupTest {
'--target=$target',
]);
applicationBinaryPath = '$testDirectory/build/app/outputs/flutter-apk/app-profile.apk';
break;
case DeviceOperatingSystem.androidArm:
await flutter('build', options: <String>[
'apk',
@@ -695,7 +694,6 @@ class StartupTest {
'--target=$target',
]);
applicationBinaryPath = '$testDirectory/build/app/outputs/flutter-apk/app-profile.apk';
break;
case DeviceOperatingSystem.androidArm64:
await flutter('build', options: <String>[
'apk',
@@ -705,7 +703,6 @@ class StartupTest {
'--target=$target',
]);
applicationBinaryPath = '$testDirectory/build/app/outputs/flutter-apk/app-profile.apk';
break;
case DeviceOperatingSystem.fake:
case DeviceOperatingSystem.fuchsia:
case DeviceOperatingSystem.linux:
@@ -720,7 +717,6 @@ class StartupTest {
]);
final String buildRoot = path.join(testDirectory, 'build');
applicationBinaryPath = _findDarwinAppInBuildDirectory(buildRoot);
break;
case DeviceOperatingSystem.windows:
await flutter('build', options: <String>[
'windows',
@@ -737,7 +733,6 @@ class StartupTest {
'Profile',
'$basename.exe'
);
break;
}
const int maxFailures = 3;
@@ -824,7 +819,6 @@ class DevtoolsStartupTest {
'--target-platform=android-arm,android-arm64',
]);
applicationBinaryPath = '$testDirectory/build/app/outputs/flutter-apk/app-profile.apk';
break;
case DeviceOperatingSystem.androidArm:
await flutter('build', options: <String>[
'apk',
@@ -833,7 +827,6 @@ class DevtoolsStartupTest {
'--target-platform=android-arm',
]);
applicationBinaryPath = '$testDirectory/build/app/outputs/flutter-apk/app-profile.apk';
break;
case DeviceOperatingSystem.androidArm64:
await flutter('build', options: <String>[
'apk',
@@ -842,7 +835,6 @@ class DevtoolsStartupTest {
'--target-platform=android-arm64',
]);
applicationBinaryPath = '$testDirectory/build/app/outputs/flutter-apk/app-profile.apk';
break;
case DeviceOperatingSystem.ios:
await flutter('build', options: <String>[
'ios',
@@ -850,7 +842,6 @@ class DevtoolsStartupTest {
'--profile',
]);
applicationBinaryPath = _findDarwinAppInBuildDirectory('$testDirectory/build/ios/iphoneos');
break;
case DeviceOperatingSystem.fake:
case DeviceOperatingSystem.fuchsia:
case DeviceOperatingSystem.linux:
@@ -1383,7 +1374,6 @@ class CompileTest {
);
metrics.addAll(sizeMetrics);
}
break;
case DeviceOperatingSystem.android:
case DeviceOperatingSystem.androidArm:
options.insert(0, 'apk');
@@ -1399,7 +1389,6 @@ class CompileTest {
if (reportPackageContentSizes) {
metrics.addAll(await getSizesFromApk(apkPath));
}
break;
case DeviceOperatingSystem.androidArm64:
options.insert(0, 'apk');
options.add('--target-platform=android-arm64');
@@ -1414,7 +1403,6 @@ class CompileTest {
if (reportPackageContentSizes) {
metrics.addAll(await getSizesFromApk(apkPath));
}
break;
case DeviceOperatingSystem.fake:
throw Exception('Unsupported option for fake devices');
case DeviceOperatingSystem.fuchsia:
@@ -1442,7 +1430,6 @@ class CompileTest {
// rather a directory containing an .exe and .dll files.
// The release size is set to the size of the produced .exe file
releaseSizeInBytes = exe.lengthSync();
break;
}
metrics.addAll(<String, dynamic>{
@@ -1470,16 +1457,13 @@ class CompileTest {
switch (deviceOperatingSystem) {
case DeviceOperatingSystem.ios:
options.insert(0, 'ios');
break;
case DeviceOperatingSystem.android:
case DeviceOperatingSystem.androidArm:
options.insert(0, 'apk');
options.add('--target-platform=android-arm');
break;
case DeviceOperatingSystem.androidArm64:
options.insert(0, 'apk');
options.add('--target-platform=android-arm64');
break;
case DeviceOperatingSystem.fake:
throw Exception('Unsupported option for fake devices');
case DeviceOperatingSystem.fuchsia:
@@ -1489,11 +1473,9 @@ class CompileTest {
case DeviceOperatingSystem.macos:
unawaited(stderr.flush());
options.insert(0, 'macos');
break;
case DeviceOperatingSystem.windows:
unawaited(stderr.flush());
options.insert(0, 'windows');
break;
}
watch.start();
await flutter('build', options: options);
@@ -1521,7 +1503,6 @@ class CompileTest {
'Flutter.framework',
'Flutter',
));
break;
case DeviceOperatingSystem.macos:
frameworkDirectory = path.join(
appPath,
@@ -1533,7 +1514,6 @@ class CompileTest {
'FlutterMacOS.framework',
'FlutterMacOS',
)); // https://github.com/flutter/flutter/issues/70413
break;
case DeviceOperatingSystem.android:
case DeviceOperatingSystem.androidArm:
case DeviceOperatingSystem.androidArm64:

View File

@@ -262,7 +262,6 @@ public class $pluginClass: NSObject, FlutterPlugin {
) != 0) {
throw TaskResult.failure('Platform unit tests failed');
}
break;
case 'ios':
await testWithNewIOSSimulator('TestNativeUnitTests', (String deviceId) async {
if (!await runXcodeTests(
@@ -275,7 +274,6 @@ public class $pluginClass: NSObject, FlutterPlugin {
throw TaskResult.failure('Platform unit tests failed');
}
});
break;
case 'linux':
if (await exec(
path.join(rootPath, 'build', 'linux', 'x64', 'release', 'plugins', 'plugintest', 'plugintest_test'),
@@ -284,7 +282,6 @@ public class $pluginClass: NSObject, FlutterPlugin {
) != 0) {
throw TaskResult.failure('Platform unit tests failed');
}
break;
case 'macos':
if (!await runXcodeTests(
platformDirectory: path.join(rootPath, 'macos'),
@@ -295,7 +292,6 @@ public class $pluginClass: NSObject, FlutterPlugin {
)) {
throw TaskResult.failure('Platform unit tests failed');
}
break;
case 'windows':
if (await exec(
path.join(rootPath, 'build', 'windows', 'plugins', 'plugintest', 'Release', 'plugintest_test.exe'),
@@ -304,7 +300,6 @@ public class $pluginClass: NSObject, FlutterPlugin {
) != 0) {
throw TaskResult.failure('Platform unit tests failed');
}
break;
}
}

View File

@@ -50,14 +50,12 @@ Widget builds: $_widgetBuilds''';
_state = FrameState.slow;
_icon = Icons.stop;
channel.invokeMethod<void>('start', _flutterFrameRate ~/ 2);
break;
case FrameState.slow:
debugPrint('Stopping .5x speed test...');
await channel.invokeMethod<void>('stop');
await _summarizeStats();
_icon = Icons.fast_forward;
_state = FrameState.afterSlow;
break;
case FrameState.afterSlow:
debugPrint('Starting 2x speed test...');
_widgetBuilds = 0;
@@ -65,20 +63,17 @@ Widget builds: $_widgetBuilds''';
_state = FrameState.fast;
_icon = Icons.stop;
channel.invokeMethod<void>('start', (_flutterFrameRate * 2).toInt());
break;
case FrameState.fast:
debugPrint('Stopping 2x speed test...');
await channel.invokeMethod<void>('stop');
await _summarizeStats();
_state = FrameState.afterFast;
_icon = Icons.replay;
break;
case FrameState.afterFast:
debugPrint('Test complete.');
_summary = 'Press play to start again';
_state = FrameState.initial;
_icon = Icons.play_arrow;
break;
}
setState(() {});
}

View File

@@ -155,22 +155,18 @@ class CalcExpression {
case ExpressionState.Start:
// Start a new number with digit.
newToken = IntToken('$digit');
break;
case ExpressionState.LeadingNeg:
// Replace the leading neg with a negative number starting with digit.
outList.removeLast();
newToken = IntToken('-$digit');
break;
case ExpressionState.Number:
final ExpressionToken last = outList.removeLast()!;
newToken = IntToken('${last.stringRep}$digit');
break;
case ExpressionState.Point:
case ExpressionState.NumberWithPoint:
final ExpressionToken last = outList.removeLast()!;
newState = ExpressionState.NumberWithPoint;
newToken = FloatToken('${last.stringRep}$digit');
break;
case ExpressionState.Result:
// Cannot enter a number now
return null;
@@ -188,13 +184,11 @@ class CalcExpression {
switch (state) {
case ExpressionState.Start:
newToken = FloatToken('.');
break;
case ExpressionState.LeadingNeg:
case ExpressionState.Number:
final ExpressionToken last = outList.removeLast()!;
final String value = last.stringRep!;
newToken = FloatToken('$value.');
break;
case ExpressionState.Point:
case ExpressionState.NumberWithPoint:
case ExpressionState.Result:
@@ -292,10 +286,8 @@ class CalcExpression {
switch (opToken.operation) {
case Operation.Addition:
currentTermValue += nextTermValue;
break;
case Operation.Subtraction:
currentTermValue -= nextTermValue;
break;
case Operation.Multiplication:
case Operation.Division:
// Logic error.

View File

@@ -603,11 +603,9 @@ class Tab2ConversationBubble extends StatelessWidget {
case Tab2ConversationBubbleColor.gray:
backgroundColor = CupertinoDynamicColor.resolve(CupertinoColors.systemFill, context);
foregroundColor = CupertinoDynamicColor.resolve(CupertinoColors.label, context);
break;
case Tab2ConversationBubbleColor.blue:
backgroundColor = CupertinoTheme.of(context).primaryColor;
foregroundColor = CupertinoColors.white;
break;
case null:
break;
}

View File

@@ -34,13 +34,10 @@ class _BannerDemoState extends State<BannerDemo> {
_displayBanner = true;
_showMultipleActions = true;
_showLeading = true;
break;
case BannerDemoAction.showMultipleActions:
_showMultipleActions = !_showMultipleActions;
break;
case BannerDemoAction.showLeading:
_showLeading = !_showLeading;
break;
}
});
}

View File

@@ -382,13 +382,10 @@ class _CardsDemoState extends State<CardsDemo> {
switch (destination.type) {
case CardDemoType.standard:
child = TravelDestinationItem(destination: destination, shape: _shape);
break;
case CardDemoType.tappable:
child = TappableTravelDestinationItem(destination: destination, shape: _shape);
break;
case CardDemoType.selectable:
child = SelectableTravelDestinationItem(destination: destination, shape: _shape);
break;
}
return Container(

View File

@@ -68,19 +68,14 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
switch (action) {
case LeaveBehindDemoAction.reset:
initListItems();
break;
case LeaveBehindDemoAction.horizontalSwipe:
_dismissDirection = DismissDirection.horizontal;
break;
case LeaveBehindDemoAction.leftSwipe:
_dismissDirection = DismissDirection.endToStart;
break;
case LeaveBehindDemoAction.rightSwipe:
_dismissDirection = DismissDirection.startToEnd;
break;
case LeaveBehindDemoAction.confirmDismiss:
_confirmDismiss = !_confirmDismiss;
break;
}
});
}

View File

@@ -212,13 +212,10 @@ class _ListDemoState extends State<ListDemo> {
case _MaterialListType.oneLine:
case _MaterialListType.oneLineWithAvatar:
itemTypeText = 'Single-line';
break;
case _MaterialListType.twoLine:
itemTypeText = 'Two-line';
break;
case _MaterialListType.threeLine:
itemTypeText = 'Three-line';
break;
case null:
break;
}

View File

@@ -57,11 +57,9 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
case AnimationStatus.dismissed:
case AnimationStatus.forward:
_controller.forward();
break;
case AnimationStatus.reverse:
case AnimationStatus.completed:
_controller.reverse();
break;
}
}
});

View File

@@ -143,7 +143,6 @@ class _ListDemoState extends State<ReorderableListDemo> {
subtitle: secondary,
secondary: const Icon(Icons.drag_handle),
);
break;
case _ReorderableListType.horizontalAvatar:
case _ReorderableListType.verticalAvatar:
listTile = SizedBox(
@@ -155,12 +154,10 @@ class _ListDemoState extends State<ReorderableListDemo> {
child: Text(item.value),
),
);
break;
case null:
listTile = Container(
key: Key(item.value),
);
break;
}
return listTile;

View File

@@ -86,26 +86,20 @@ class _CustomRangeThumbShape extends RangeSliderThumbShape {
switch (thumb) {
case Thumb.start:
thumbPath = _rightTriangle(size, center);
break;
case Thumb.end:
thumbPath = _leftTriangle(size, center);
break;
case null:
break;
}
break;
case TextDirection.ltr:
switch (thumb) {
case Thumb.start:
thumbPath = _leftTriangle(size, center);
break;
case Thumb.end:
thumbPath = _rightTriangle(size, center);
break;
case null:
break;
}
break;
case null:
break;
}

View File

@@ -208,7 +208,6 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
flutterViewEvents.removeLast();
}
setState(() {});
break;
}
return Future<dynamic>.value();
}
@@ -222,7 +221,6 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
embeddedViewEvents.removeLast();
}
setState(() {});
break;
}
return Future<dynamic>.value();
}

View File

@@ -236,13 +236,10 @@ class _MyHomePageState extends State<MyHomePage> {
switch (widget.setup) {
case Setup.none:
imageWidget = Container();
break;
case Setup.image:
imageWidget = Image.memory(base64Decode(_displayP3Logo));
break;
case Setup.canvasSaveLayer:
imageWidget = CustomPaint(painter: _SaveLayerDrawer(_image));
break;
case Setup.blur:
imageWidget = Stack(
children: <Widget>[
@@ -258,7 +255,6 @@ class _MyHomePageState extends State<MyHomePage> {
child: Image.memory(base64Decode(_displayP3Logo))),
],
);
break;
}
return Scaffold(

View File

@@ -286,19 +286,15 @@ class CardCollectionState extends State<CardCollection> {
switch (_dismissDirection) {
case DismissDirection.horizontal:
backgroundMessage = 'Swipe in either direction';
break;
case DismissDirection.endToStart:
backgroundMessage = 'Swipe left to dismiss';
break;
case DismissDirection.startToEnd:
backgroundMessage = 'Swipe right to dismiss';
break;
case DismissDirection.vertical:
case DismissDirection.up:
case DismissDirection.down:
case DismissDirection.none:
backgroundMessage = 'Unsupported dismissDirection';
break;
}
// This icon is wrong in RTL.

View File

@@ -160,12 +160,10 @@ class _PointDemoState extends State<_PointDemo> {
setState(() {
_begin = _begin! + details.delta;
});
break;
case _DragTarget.end:
setState(() {
_end = _end! + details.delta;
});
break;
}
}
@@ -322,12 +320,10 @@ class _RectangleDemoState extends State<_RectangleDemo> {
setState(() {
_begin = _begin?.shift(details.delta);
});
break;
case _DragTarget.end:
setState(() {
_end = _end?.shift(details.delta);
});
break;
}
}

View File

@@ -481,13 +481,10 @@ class _TestMenusState extends State<_TestMenus> {
switch (checkboxState) {
case false:
checkboxState = true;
break;
case true:
checkboxState = null;
break;
case null:
checkboxState = false;
break;
}
});
}
@@ -506,10 +503,8 @@ class _TestMenusState extends State<_TestMenus> {
case TestMenu.radioMenu2:
case TestMenu.radioMenu3:
shortcuts[item.shortcut!] = VoidCallbackIntent(() => _setRadio(item));
break;
case TestMenu.subMenu1:
shortcuts[item.shortcut!] = VoidCallbackIntent(() => _setCheck(item));
break;
case TestMenu.mainMenu1:
case TestMenu.mainMenu2:
case TestMenu.mainMenu3:
@@ -529,7 +524,6 @@ class _TestMenusState extends State<_TestMenus> {
case TestMenu.standaloneMenu1:
case TestMenu.standaloneMenu2:
shortcuts[item.shortcut!] = VoidCallbackIntent(() => _itemSelected(item));
break;
}
}
_shortcutsEntry = ShortcutRegistry.of(context).addAll(shortcuts);

View File

@@ -170,8 +170,7 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
case 0:
return const TextStyle();
case 1:
style = const TextStyle();
break; // and mutate it below
style = const TextStyle(); // is mutated below
default:
return null;
}
@@ -211,7 +210,6 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
case 3:
return value.withBlue(value.blue + _random.nextInt(10) - 5);
}
break;
case 1:
return null;
}
@@ -322,10 +320,8 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
case 3:
case 4:
children.insert(_random.nextInt(children.length + 1), _createRandomTextSpan());
break;
case 10:
children = children.reversed.toList();
break;
case 20:
if (children.isEmpty) {
break;
@@ -337,7 +333,6 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
if (depthOf(children[index]) < 3) {
children.removeAt(index);
}
break;
}
if (children.isEmpty && _random.nextBool()) {
return null;

View File

@@ -405,10 +405,8 @@ String generateType(Map<String, dynamic>? attributes) {
switch (attributes['x-flutter-type'] as String?) {
case 'icuShortTimePattern':
type = 'TimeOfDayFormat';
break;
case 'scriptCategory':
type = 'ScriptCategory';
break;
}
}
return type + (optional ? '?' : '');

View File

@@ -71,12 +71,10 @@ class LocaleInfo implements Comparable<LocaleInfo> {
case 'CN':
case 'SG':
scriptCode = 'Hans';
break;
case 'TW':
case 'HK':
case 'MO':
scriptCode = 'Hant';
break;
}
break;
}
@@ -339,13 +337,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

@@ -156,16 +156,12 @@ class PathCommandAnimation {
switch (type) {
case 'M':
dartCommandClass = '_PathMoveTo';
break;
case 'C':
dartCommandClass = '_PathCubicTo';
break;
case 'L':
dartCommandClass = '_PathLineTo';
break;
case 'Z':
dartCommandClass = '_PathClose';
break;
default:
throw Exception('unsupported path command: $type');
}