Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fujidaiti committed Dec 18, 2024
1 parent 0546d9d commit ecd076e
Show file tree
Hide file tree
Showing 8 changed files with 1,661 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/src/foundation/sheet_activity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ mixin UserControlledSheetActivityMixin<T extends SheetPosition>
}
}

/// Appends the delta of the bottom viewport inset, which is typically
/// Appends the negative delta of the bottom viewport inset, which is typically
/// equal to the height of the on-screen keyboard, to the [activityOwner]'s
/// `pixels` to maintain the visual sheet position.
@internal
Expand Down
14 changes: 9 additions & 5 deletions lib/src/paged/paged_sheet_geometry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const kDefaultPagedSheetMinOffset = SheetAnchor.proportional(1);
@internal
const kDefaultPagedSheetMaxOffset = SheetAnchor.proportional(1);

@internal
const kDefaultPagedSheetTransitionCurve = Curves.easeInOutCubic;

class _RouteGeometry {
Size? oldContentSize;
Size? contentSize;
Expand Down Expand Up @@ -157,7 +160,7 @@ class PagedSheetGeometry extends DraggableScrollableSheetPosition {
assert(_routeGeometries.containsKey(originRoute));
assert(_routeGeometries.containsKey(destinationRoute));
_setCurrentRoute(null);
beginActivity(_PageTransitionSheetActivity(
beginActivity(RouteTransitionSheetActivity(
originRouteOffset: () => _routeGeometries[originRoute]?.offset,
destinationRouteOffset: () => _routeGeometries[destinationRoute]?.offset,
animation: animation,
Expand All @@ -179,7 +182,7 @@ class PagedSheetGeometry extends DraggableScrollableSheetPosition {
originRoute: originRoute,
destinationRoute: destinationRoute,
animation: animation,
animationCurve: Curves.easeInOutCubic,
animationCurve: kDefaultPagedSheetTransitionCurve,
);

case BackwardRouteTransition(
Expand All @@ -191,7 +194,7 @@ class PagedSheetGeometry extends DraggableScrollableSheetPosition {
originRoute: originRoute,
destinationRoute: destinationRoute,
animation: animation,
animationCurve: Curves.easeInOutCubic,
animationCurve: kDefaultPagedSheetTransitionCurve,
);

case UserGestureRouteTransition(
Expand All @@ -213,8 +216,9 @@ class PagedSheetGeometry extends DraggableScrollableSheetPosition {
}
}

class _PageTransitionSheetActivity extends SheetActivity<PagedSheetGeometry> {
_PageTransitionSheetActivity({
@visibleForTesting
class RouteTransitionSheetActivity extends SheetActivity<PagedSheetGeometry> {
RouteTransitionSheetActivity({
required this.originRouteOffset,
required this.destinationRouteOffset,
required this.animation,
Expand Down
Loading

0 comments on commit ecd076e

Please sign in to comment.