-
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.
- Loading branch information
Showing
12 changed files
with
113 additions
and
30 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Migration guide to 0.3.x from 0.2.x | ||
|
||
## enablePullToDismiss removed from modal sheets | ||
|
||
The `enablePullToDismiss` property, that enables the pull-to-dismiss action for the modal sheets, was removed from the constructors of `ModalSheetRoute`, `ModalSheetPage`, `CupertinoModalSheetRoute,` and `CupertinoModalSheetPage`. Instead, wrap the sheet with a `SheetDismissible` to create the same behavior. See the [tutorial code](https://github.com/fujidaiti/smooth_sheets/blob/90c8f10b89db5b18c1fd382692cfba3a09be67f1/cookbook/lib/tutorial/imperative_modal_sheet.dart#L52) for more detailed usage. | ||
|
||
BEFORE: | ||
```dart | ||
ModalSheetRoute( | ||
enablePullToDismiss: true, | ||
(context) => MySheet(...), | ||
); | ||
``` | ||
|
||
AFTER: | ||
```dart | ||
ModalSheetRoute( | ||
(context) => SheetDismissible( | ||
onDismiss: () {...}, // Dismissing event can be handled here. | ||
child: MySheet(...), | ||
), | ||
); | ||
``` | ||
|
||
## SnapToNearest can no longer be `const` | ||
|
||
`SnapToNearest` can no longer be a `const` in exchange for performance improvement. Due to this, `SnapToNearestEdge` is now used as the default value for `SnappingSheetPhysics.snappingBehavior` instead. If you want the sheet to snap only to the `minPixels` and the `maxPixels`, it is preferable to use `SnapToNearestEdge` rather than `SnapToNearest` as it is more simplified and performant. | ||
|
||
BEFORE: | ||
|
||
```dart | ||
physics: const StretchingSheetPhysics( | ||
parent: SnappingSheetPhysics( | ||
snappingBehavior: SnapToNearest( | ||
snapTo: [ | ||
Extent.proportional(0.2), | ||
Extent.proportional(0.5), | ||
Extent.proportional(1), | ||
], | ||
), | ||
), | ||
), | ||
``` | ||
|
||
AFTER: | ||
|
||
```dart | ||
physics: StretchingSheetPhysics( // Can no longer be a const | ||
parent: SnappingSheetPhysics( | ||
snappingBehavior: SnapToNearest( | ||
snapTo: [ | ||
const Extent.proportional(0.2), | ||
const Extent.proportional(0.5), | ||
const Extent.proportional(1), | ||
], | ||
), | ||
), | ||
), | ||
``` |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
![cookbook-ai-playlist-generator](https://github.com/fujidaiti/smooth_sheets/assets/68946713/f34ad8f7-2435-4bed-adbf-2d61c659c803) | ||
![cookbook-ai-playlist-generator](https://github.com/fujidaiti/smooth_sheets/assets/68946713/636d5ca8-2883-4447-ad75-47fcb210718c) | ||
![cookbook-sheet-physics](https://github.com/fujidaiti/smooth_sheets/assets/68946713/e08e3f58-cc98-4858-8b76-6e84a7e9e416) | ||
![cookbook-sheet-draggable](https://github.com/fujidaiti/smooth_sheets/assets/68946713/aacc7b27-3d6f-4314-8672-d6f99fafabed) | ||
![cookbook-sheet-controller](https://github.com/fujidaiti/smooth_sheets/assets/68946713/40f3fba5-9fec-40e8-a5cf-8f0312b57288) | ||
![cookbook-sheet-content-scaffold](https://github.com/fujidaiti/smooth_sheets/assets/68946713/52a0de82-b85c-4b2f-b10a-eb882b849900) | ||
![cookbook-scrollable-sheet](https://github.com/fujidaiti/smooth_sheets/assets/68946713/28cf4760-de78-425b-a64e-c2ac6fb6817c) | ||
![cookbook-imperative-navigation-sheet](https://github.com/fujidaiti/smooth_sheets/assets/68946713/2f56696c-5086-4235-88a8-a2ce60cd8637) | ||
![cookbook-imerative-modal-sheet](https://github.com/fujidaiti/smooth_sheets/assets/68946713/47e7c7a8-cf1a-451c-bc6b-b0fcb3fbf4aa) | ||
![cookbook-imperative-modal-sheet](https://github.com/fujidaiti/smooth_sheets/assets/68946713/f2212362-e193-4dab-8f8b-f24942051775) | ||
![cookbook-draggable-sheet](https://github.com/fujidaiti/smooth_sheets/assets/68946713/51c483a0-5d1d-49d1-bff1-0051d1d3d937) | ||
![cookbook-declerative-modal-sheet](https://github.com/fujidaiti/smooth_sheets/assets/68946713/67128764-e809-4bff-ae2d-b0884928a2da) | ||
![cookbook-declarative-modal-sheet](https://github.com/fujidaiti/smooth_sheets/assets/68946713/67128764-e809-4bff-ae2d-b0884928a2da) | ||
![cookbook-declarative-navigation-sheet](https://github.com/fujidaiti/smooth_sheets/assets/68946713/3367d3bc-a895-42be-8154-2f6fc83b30b5) | ||
![cookbook-airbnb-mobile-app](https://github.com/fujidaiti/smooth_sheets/assets/68946713/1fb3f047-c993-42be-9a7e-b3efc89be635) | ||
![cookbook-extent-driven-animation](https://github.com/fujidaiti/smooth_sheets/assets/68946713/8b9ed0ef-675e-4468-8a3f-cd3f1ed3dfb0) | ||
![cookbook-cupertino-modal-sheet](https://github.com/fujidaiti/smooth_sheets/assets/68946713/242a8d32-a355-4d4a-8248-4572a03c64eb) | ||
![cookbook-safari](https://github.com/fujidaiti/smooth_sheets/assets/68946713/ad3f0ec1-fd7b-45d3-94a3-0b17c12b5889) | ||
![cookbook-safari](https://github.com/fujidaiti/smooth_sheets/assets/68946713/cfbc79d1-4290-4dec-88bd-a355a27726ea) |