-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make stretching behavior of StretchingSheetPhysics more customizable (#…
…171) Closes #159. ## Breaking Changes - Removed the `StretchingSheetPhysics.stretchingRange` property. - Added `StretchingBehavior` and its subclasses as the replacements. - `FixedStretchingBehavior`: Allows a sheet to stretch by up to a fixed amount. - `DirectionAwareStretchingBehavior`: Similar to `FixedStretchingBehavior`, but can accept different values for upward and downward directions. ## Misc - Added the migration guide. - Updated README and CHANGELOG.
- Loading branch information
Showing
5 changed files
with
139 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Migration guide to 0.8.x from 0.7.x | ||
|
||
Here is the summary of the breaking changes included in the version 0.8.0. | ||
|
||
## Changes in StretchingSheetPhysics | ||
|
||
### New way to control the stretching behavior of a sheet | ||
|
||
[StretchingSheetBehavior](https://pub.dev/documentation/smooth_sheets/latest/smooth_sheets/StretchingSheetBehavior-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. | ||
|
||
**BEFORE:** | ||
|
||
```dart | ||
const physics = StretchingSheetPhysics( | ||
stretchingRange: Extent.proportional(0.1), | ||
); | ||
``` | ||
|
||
**AFTER:** | ||
|
||
```dart | ||
const physics = StretchingSheetPhysics( | ||
behavior: FixedStretchingBehavior(Extent.proportional(0.1)), | ||
); | ||
``` | ||
|
||
See also: | ||
|
||
- [FixedStretchingBehavior](https://pub.dev/documentation/smooth_sheets/latest/smooth_sheets/FixedStretchingBehavior-class.html), which stretches the sheet by a fixed amount. | ||
- [DirectionAwareStretchingBehavior](https://pub.dev/documentation/smooth_sheets/latest/smooth_sheets/DirectionAwareStretchingBehavior-class.html), which stretches the sheet by a fixed amount, based on the direction of a drag. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters