Skip to content

Commit

Permalink
Merge pull request #273 from AcarFurkan/main
Browse files Browse the repository at this point in the history
Prepare 0.8.0 release
  • Loading branch information
ulusoyca authored Jul 23, 2024
2 parents 64911e8 + aabc1ee commit be3e1cb
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 15 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 0.8.0
- Fix: Consider directionality for pagination animation [#272](https://github.com/woltapp/wolt_modal_sheet/pull/272) by [ulusoyca](https://github.com/ulusoyca)
- Issue:
- [#266](https://github.com/woltapp/wolt_modal_sheet/issues/266) Transition direction for pages ( rtl - ltr )
- Fix existing tests [#270](https://github.com/woltapp/wolt_modal_sheet/pull/270) by [TahaTesser](https://github.com/TahaTesser)
- Breaking Change: Renamed WoltModalSheetRoute routeSettings to settings [#268](https://github.com/woltapp/wolt_modal_sheet/pull/268) by [durannumit](https://github.com/durannumit)
- Issue:
- [#198](https://github.com/woltapp/wolt_modal_sheet/issues/198) Rename [WoltModalSheetRoute.routeSettings] fields as [WoltModalSheetRoute.settings]
- Breaking Change: Introduce modal and page content decorators [#267](https://github.com/woltapp/wolt_modal_sheet/pull/267) by [ulusoyca](https://github.com/ulusoyca)
- Example app: Add attached sheet example to playground app [#265](https://github.com/woltapp/wolt_modal_sheet/pull/265) by [ABausG](https://github.com/ABausG)
- Added source codes of example projects to Readme [#264](https://github.com/woltapp/wolt_modal_sheet/pull/264) by [durannumit](https://github.com/durannumit)
- Issue:
- [#263](https://github.com/woltapp/wolt_modal_sheet/issues/263) Add links to repositories in ReadMe for showcase apps.
## 0.7.1
- Fix: Dialog and bottom sheet minimum height is not respected to modal content min height [#260](https://github.com/woltapp/wolt_modal_sheet/pull/260) by [ulusoyca](https://github.com/ulusoyca)
- Adjustment: Add Last Commit badge to readme [#258](https://github.com/woltapp/wolt_modal_sheet/pull/258) by [durannumit](https://github.com/durannumit)
Expand Down
41 changes: 27 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ dynamical screen width:
## Decorating modal types, modal, and pages
WoltModalSheet uses the decorator pattern, which is a structural design
pattern allowing dynamic addition of behavior to individual objects. In
Flutter, this is typically achieved by wrapping widgets with other widgets,
enhancing or modifying their behavior.
Flutter, this is typically achieved by wrapping widgets with other widgets
to enhance or modify their behavior.

### Decoration Approaches

Expand All @@ -355,8 +355,8 @@ Decoration can be achieved at both the modal type level and the modal level.
#### Modal Type Level Decoration

The modal type level decoration is applied to all modals of the same type.
To decorate at the modal type level, you extend the corresponding
`WoltModalType` class and override the related methods.
To decorate at the modal type level, the corresponding `WoltModalType` class
should be extended and the related methods should be overridden.

Example:

Expand Down Expand Up @@ -402,15 +402,27 @@ WoltModalSheet.show(
),
modalDecorator: (child) {
// Wrap the modal with `ChangeNotifierProvider` to manage the state of
// the entire pages.
return ChangeNotifierProvider<StoreOnlineViewModel>.value(
value: viewModel,
builder: (_, __) => child,
// the entire pages in the modal.
return ChangeNotifierProvider<StoreOnlineViewModel>(
builder: (_, __) => StoreOnlineViewModel(),
child: child,
);
},
pageListBuilder: (context) => [
// Your pages here
],
pageListBuilder: (context) {
final viewModel = context.read<StoreOnlineViewModel>();
return [
WoltModalSheetPage(
child: FirstPageContent(viewModel.data),
pageTitle: Text('First Page Title'),
// Other properties...
),
WoltModalSheetPage(
child: SecondPageContent(viewModel.data),
pageTitle: Text('Second Page Title'),
// Other properties...
),
];
},
);
```

Expand All @@ -421,7 +433,8 @@ WoltModalSheet.show(
- Purpose: Applies additional decorations to the modal page content only,
excluding the barrier.
- Usage: Useful for modifying or enhancing the appearance and behavior of
the modal content without affecting the surrounding barrier.
the modal content without affecting the surrounding barrier and the
placement of the modal on the screen.

```dart
Widget Function(Widget)? pageContentDecorator;
Expand All @@ -440,8 +453,8 @@ Widget Function(Widget)? modalDecorator;

##### Why use modalDecorator for state management?

When managing the state across the entire modal, such as providing a
ChangeNotifierProvider for state management, it is important to wrap the
When managing the state across the entire modal, for example by providing a
[ChangeNotifierProvider](https://pub.dev/documentation/provider/latest/provider/ChangeNotifierProvider-class.html) for state management, it is important to wrap the
entire modal rather than just the page content. This ensures that the state
is accessible throughout the entire modal lifecycle and all its components.

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: wolt_modal_sheet
description: This package provides a responsive modal with multiple pages, motion animation for page transitions, and scrollable content within each page.
version: 0.7.1
version: 0.8.0
repository: https://github.com/woltapp/wolt_modal_sheet

environment:
Expand Down

0 comments on commit be3e1cb

Please sign in to comment.