Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme for breaking changes of 0.2.0 #114

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 49 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,53 @@ WoltModalSheetPage(
* Choose WoltModalSheetPage for simpler content layouts or when working with
a single widget.

### Migration from 0.1.x to 0.2.0

This section provides detailed guidance on the breaking changes introduced in
version 0.2.0, particularly focusing on the usage of the `WoltModalSheetPage`
class.

#### Changes Overview

* The previous constructors `WoltModalSheetPage.withSingleChild` and
`WoltModalSheetPage.withCustomSliverList` have been removed in this update.
* We have introduced a new class, `SliverWoltModalSheetPage`, which now
serves as the base class for pages. This new class is intended to replace the
`WoltModalSheetPage.withCustomSliverList` constructor.
* The `WoltModalSheetPage` class has been updated to extend from
`SliverWoltModalSheetPage`. This substitutes the `WoltModalSheetPage.
withSingleChild` constructor.
* The `mainContentSlivers` property is now added to
`SliverWoltModalSheetPage` to replace the `sliverList` property of
`WoltModalSheetPage.withCustomSliverList`. This allows using list of
sliver widgets instead of a single sliver list in sliver pages.

#### Migration Steps

* If your previous implementation used `WoltModalSheetPage.withSingleChild`,
you can now directly transition to using `WoltModalSheetPage`.

```dart
// Before
WoltModalSheetPage.withSingleChild(child: MyWidget());

// After
WoltModalSheetPage(child: MyWidget());
```

* If you were utilizing `WoltModalSheetPage.withCustomSliverList` for complex,
sliver-based content, switch to `SliverWoltModalSheetPage`. Utilize the
`mainContentSlivers` property to achieve a similar but more enhanced
functionality.

```dart
// Before
WoltModalSheetPage.withCustomSliverList(sliverList: MySliverList());

// After
SliverWoltModalSheetPage(mainContentSlivers: [MySliverList1(), MySliverList2()]);
```

## Getting started

To use this plugin, add wolt_modal_sheet as a dependency in your pubspec.yaml
Expand Down Expand Up @@ -459,7 +506,8 @@ Pagination involves a sequence of screens the user navigates sequentially. We ch
The code snippet above produces the following:
</br>
</br>
![Example app](https://github.com/woltapp/wolt_modal_sheet/blob/main/doc/wms_demo.gif?raw=true)

![Example app](https://github.com/woltapp/wolt_modal_sheet/blob/main/doc/example_wms_demo.gif?raw=true)

### Playground app with imperative navigation

Expand Down
Binary file added doc/example_wms_demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/wms_demo.gif
Binary file not shown.