From 559f1ce246671fb64a2f1811fee98531fc619dd9 Mon Sep 17 00:00:00 2001 From: Daichi Fujita <68946713+fujidaiti@users.noreply.github.com> Date: Thu, 20 Jun 2024 20:24:05 +0900 Subject: [PATCH] Replace 'stretch' with 'bounce' (#177) This PR fixes the following comments that should have been included in #173. - https://github.com/fujidaiti/smooth_sheets/pull/173#discussion_r1646974405 - https://github.com/fujidaiti/smooth_sheets/pull/173#discussion_r1646975149 - https://github.com/fujidaiti/smooth_sheets/pull/173#discussion_r1647412078 --- docs/migration-guide-0.8.x.md | 6 +++--- package/test/foundation/physics_test.dart | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/migration-guide-0.8.x.md b/docs/migration-guide-0.8.x.md index d8859735..83d0ff7e 100644 --- a/docs/migration-guide-0.8.x.md +++ b/docs/migration-guide-0.8.x.md @@ -10,7 +10,7 @@ Here is the summary of the breaking changes included in the version 0.8.0. ### New way to control the bouncing behavior of a sheet -[BouncingSheetBehavior](https://pub.dev/documentation/smooth_sheets/latest/smooth_sheets/BouncingSheetBehavior-class.html) was added as the new way to control the stretching behavior of a sheet. It replaces `StretchingSheetPhysics.stretchingRange` property, which has been removed. +[BouncingSheetBehavior](https://pub.dev/documentation/smooth_sheets/latest/smooth_sheets/BouncingSheetBehavior-class.html) was added as the new way to control the bouncing behavior of a sheet. It replaces `StretchingSheetPhysics.stretchingRange` property, which has been removed. **BEFORE:** @@ -30,5 +30,5 @@ const physics = BouncingSheetPhysics( See also: -- [FixedBouncingBehavior](https://pub.dev/documentation/smooth_sheets/latest/smooth_sheets/FixedBouncingBehavior-class.html), which stretches the sheet by a fixed amount. -- [DirectionAwareBouncingBehavior](https://pub.dev/documentation/smooth_sheets/latest/smooth_sheets/DirectionAwareBouncingBehavior-class.html), which stretches the sheet by a fixed amount, based on the direction of a drag. +- [FixedBouncingBehavior](https://pub.dev/documentation/smooth_sheets/latest/smooth_sheets/FixedBouncingBehavior-class.html), which allows the sheet position to exceeds the content bounds by a fixed amount. +- [DirectionAwareBouncingBehavior](https://pub.dev/documentation/smooth_sheets/latest/smooth_sheets/DirectionAwareBouncingBehavior-class.html), which is similar to `FixedBouncingBehavior`, but the different bounceable range can be set for each direction. diff --git a/package/test/foundation/physics_test.dart b/package/test/foundation/physics_test.dart index b792b704..dd9fb4b4 100644 --- a/package/test/foundation/physics_test.dart +++ b/package/test/foundation/physics_test.dart @@ -36,7 +36,7 @@ void main() { group('$SheetPhysics subclasses', () { test('can create dynamic inheritance relationships', () { const clamp = ClampingSheetPhysics(); - const stretch = BouncingSheetPhysics(); + const bounce = BouncingSheetPhysics(); const snap = SnappingSheetPhysics(); List getChain(SheetPhysics physics) { @@ -47,17 +47,17 @@ void main() { } expect( - getChain(clamp.applyTo(stretch).applyTo(snap)).join(' -> '), + getChain(clamp.applyTo(bounce).applyTo(snap)).join(' -> '), 'ClampingSheetPhysics -> BouncingSheetPhysics -> SnappingSheetPhysics', ); expect( - getChain(snap.applyTo(stretch).applyTo(clamp)).join(' -> '), + getChain(snap.applyTo(bounce).applyTo(clamp)).join(' -> '), 'SnappingSheetPhysics -> BouncingSheetPhysics -> ClampingSheetPhysics', ); expect( - getChain(stretch.applyTo(clamp).applyTo(snap)).join(' -> '), + getChain(bounce.applyTo(clamp).applyTo(snap)).join(' -> '), 'BouncingSheetPhysics -> ClampingSheetPhysics -> SnappingSheetPhysics', ); });