Skip to content

Commit

Permalink
Update reorderable_list.dart to use Dart 3 return switch statement fo…
Browse files Browse the repository at this point in the history
…r consistency (#147505)

*Update `reorderable_list.dart` from `widgets` to use Dart 3 return switch statement syntax for consistency.*

This just a syntax change to match the rest of the functions in this file
  • Loading branch information
ellet0 committed May 1, 2024
1 parent d33bb8f commit 8bf614f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/flutter/lib/src/widgets/reorderable_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1486,12 +1486,10 @@ double _sizeExtent(Size size, Axis scrollDirection) {
}

Size _extentSize(double extent, Axis scrollDirection) {
switch (scrollDirection) {
case Axis.horizontal:
return Size(extent, 0);
case Axis.vertical:
return Size(0, extent);
}
return switch (scrollDirection) {
Axis.horizontal => Size(extent, 0),
Axis.vertical => Size(0, extent),
};
}

double _offsetExtent(Offset offset, Axis scrollDirection) {
Expand Down

0 comments on commit 8bf614f

Please sign in to comment.