Skip to content

Commit a13ca2f

Browse files
Delete unreachable default clauses. (bluefireteam#561)
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. For details see dart-lang/sdk#54575. This PR deletes unreachable `default` clauses from `photo_view` now, to avoid a spurious warning when the analyzer change lands.
1 parent 47d347d commit a13ca2f

2 files changed

Lines changed: 0 additions & 5 deletions

File tree

lib/photo_view.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,6 @@ PhotoViewScaleState defaultScaleStateCycle(PhotoViewScaleState actual) {
585585
case PhotoViewScaleState.zoomedIn:
586586
case PhotoViewScaleState.zoomedOut:
587587
return PhotoViewScaleState.initial;
588-
default:
589-
return PhotoViewScaleState.initial;
590588
}
591589
}
592590

lib/src/utils/photo_view_utils.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ double getScaleForScaleState(
2121
scaleBoundaries);
2222
case PhotoViewScaleState.originalSize:
2323
return _clampSize(1.0, scaleBoundaries);
24-
// Will never be reached
25-
default:
26-
return 0;
2724
}
2825
}
2926

0 commit comments

Comments
 (0)