Skip to content

Commit

Permalink
support LocalHistoryEntry.impliesAppBarDismissal
Browse files Browse the repository at this point in the history
  • Loading branch information
hcbpassos committed Aug 29, 2023
1 parent e884158 commit 05a11b7
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/src/drag_select_grid_view/drag_select_grid_view.dart
Expand Up @@ -94,6 +94,7 @@ class DragSelectGridView extends StatefulWidget {
this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
this.restorationId,
this.clipBehavior = Clip.hardEdge,
this.impliesAppBarDismissal = true,
}) : autoScrollHotspotHeight =
autoScrollHotspotHeight ?? defaultAutoScrollHotspotHeight,
scrollController = scrollController ?? ScrollController(),
Expand Down Expand Up @@ -183,6 +184,9 @@ class DragSelectGridView extends StatefulWidget {
/// Refer to [ScrollView.clipBehavior].
final Clip clipBehavior;

/// Refer to [LocalHistoryEntry.impliesAppBarDismissal].
final bool impliesAppBarDismissal;

@override
DragSelectGridViewState createState() => DragSelectGridViewState();
}
Expand Down Expand Up @@ -359,11 +363,14 @@ class DragSelectGridViewState extends State<DragSelectGridView>

if (isSelecting) {
if (_historyEntry == null) {
final entry = LocalHistoryEntry(onRemove: () {
setState(_selectionManager.clear);
_notifySelectionChange();
_historyEntry = null;
});
final entry = LocalHistoryEntry(
impliesAppBarDismissal: widget.impliesAppBarDismissal,
onRemove: () {
setState(_selectionManager.clear);
_notifySelectionChange();
_historyEntry = null;
},
);
route.addLocalHistoryEntry(entry);
_historyEntry = entry;
}
Expand Down

0 comments on commit 05a11b7

Please sign in to comment.