Skip to content
Open
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
5 changes: 5 additions & 0 deletions lib/src/side_sheet_entry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class SideSheetEntry<T> {
/// A decoration widget builder which helps creating custom design.
final DecorationBuilder? decorationBuilder;

final Function? dismissCallback;

SideSheetEntry({
required this.id,
required this.index,
Expand All @@ -43,6 +45,7 @@ class SideSheetEntry<T> {
required this.position,
required this.dismissible,
required this.decorationBuilder,
this.dismissCallback,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the name of the function onDismissCallback

});

factory SideSheetEntry.createNewElement({
Expand All @@ -58,6 +61,7 @@ class SideSheetEntry<T> {
required bool dismissible,
required int index,
bool initWithAnimation = true,
Function? dismissCB,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the name of the function onDismissCallback

}) {
final key = UniqueKey();

Expand Down Expand Up @@ -85,6 +89,7 @@ class SideSheetEntry<T> {
position: position,
dismissible: dismissible,
decorationBuilder: decorationBuilder,
dismissCallback: dismissCB,
);
}

Expand Down
3 changes: 3 additions & 0 deletions lib/src/side_sheet_host.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class NestedSideSheetState extends State<NestedSideSheet>
bool dismissible = true,
Duration? animationDuration,
Duration? reverseAnimationDuration,
Function? dismissCallback,
}) async {
if (!mounted || _blockGestures) return null;
final completer = Completer<T?>();
Expand All @@ -127,6 +128,7 @@ class NestedSideSheetState extends State<NestedSideSheet>
dismissible: dismissible,
animationDuration: _setSettleDuration(animationDuration),
reverseDuration: _setReverseSettleDuration(reverseAnimationDuration),
dismissCB: dismissCallback,
);
_sheetEntries.add(newEntry);
_notifyStateChange();
Expand Down Expand Up @@ -155,6 +157,7 @@ class NestedSideSheetState extends State<NestedSideSheet>
if (_sheetEntries.last != entry) {
_removeSheetSilently(entry);
}
entry.dismissCallback?.call();
}

_notifyStateChange();
Expand Down