Skip to content

Commit a20c629

Browse files
committed
🎉 Release based_split_view v1.2.2 🎉
1 parent aefa8d0 commit a20c629

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/based_split_view/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.2.2
2+
3+
🔧Drop 1.2.1 Changes
4+
15
## 1.2.1
26

37
📖Update README.md to fix broken links

packages/based_split_view/lib/src/based_split_view.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ class _BasedSplitViewState extends State<BasedSplitView> {
106106

107107
if (singleView) {
108108
return Navigator(
109+
onPopPage: _onPopPage,
109110
key: widget.navigatorKey,
110111
pages: [
111112
CupertinoPage(
112-
canPop: false,
113113
child: widget.leftWidget,
114114
),
115115
],
@@ -121,9 +121,9 @@ class _BasedSplitViewState extends State<BasedSplitView> {
121121
final rightWidget = ScaffoldMessenger(
122122
child: Navigator(
123123
key: widget.navigatorKey,
124+
onPopPage: _onPopPage,
124125
pages: [
125126
CupertinoPage(
126-
canPop: false,
127127
child: Center(
128128
child: widget.rightPlaceholder,
129129
),
@@ -185,4 +185,10 @@ class _BasedSplitViewState extends State<BasedSplitView> {
185185

186186
return clampDouble(leftWidth, min, max);
187187
}
188+
189+
bool _onPopPage(Route<dynamic> route, dynamic result) {
190+
/// Prevent to pop root page
191+
if (route.isFirst) return false;
192+
return route.didPop(result);
193+
}
188194
}

0 commit comments

Comments
 (0)