Skip to content

Commit

Permalink
Replace 'stretch' with 'bounce'
Browse files Browse the repository at this point in the history
  • Loading branch information
fujidaiti committed Jun 20, 2024
1 parent 4b51fa0 commit bd24caf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docs/migration-guide-0.8.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:**

Expand All @@ -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.
8 changes: 4 additions & 4 deletions package/test/foundation/physics_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<Type> getChain(SheetPhysics physics) {
Expand All @@ -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',
);
});
Expand Down

0 comments on commit bd24caf

Please sign in to comment.