Skip to content

Commit dbca087

Browse files
committed
change the overlay to a dummy navigator since it messed w/ navigation otherwise
Signed-off-by: Tejas Mehta <[email protected]>
1 parent 9a74768 commit dbca087

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

lib/routing/portfolio_router_delegate.dart

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,27 @@ class PortfolioRouterDelegate extends RouterDelegate<PortfolioRoutePath>
3131

3232
@override
3333
Widget build(BuildContext context) {
34-
return PortfolioRouteControllerWidget(
35-
initialRoute: _currentPage.path,
36-
delegate: this,
37-
child: Overlay(
38-
initialEntries: [
39-
OverlayEntry(builder: (context) => Scaffold(
40-
key: _scaffoldKey,
41-
appBar: _createAppbar(context),
42-
drawer: MediaQuery.of(context).size.width <= 500 ? _createDrawer(context) : null,
43-
body: Navigator(
44-
key: navigatorKey,
45-
pages: [
46-
_getPathForRoute(_currentPage)
47-
],
48-
onPopPage: (route, result) {
49-
if (!route.didPop(result)) return false;
50-
_currentPage.removeFragment();
51-
notifyListeners();
52-
return true;
53-
},
54-
),
55-
))
56-
],
34+
return createDummyNavigator(
35+
child: PortfolioRouteControllerWidget(
36+
initialRoute: _currentPage.path,
37+
delegate: this,
38+
child: Scaffold(
39+
key: _scaffoldKey,
40+
appBar: _createAppbar(context),
41+
drawer: MediaQuery.of(context).size.width <= 500 ? _createDrawer(context) : null,
42+
body: Navigator(
43+
key: navigatorKey,
44+
pages: [
45+
_getPathForRoute(_currentPage)
46+
],
47+
onPopPage: (route, result) {
48+
if (!route.didPop(result)) return false;
49+
_currentPage.removeFragment();
50+
notifyListeners();
51+
return true;
52+
},
53+
),
54+
)
5755
),
5856
);
5957
}
@@ -122,10 +120,12 @@ class PortfolioRouterDelegate extends RouterDelegate<PortfolioRoutePath>
122120
return Text(subject, style: isCurrent ? buttonStyle.merge(TextStyle(decoration: TextDecoration.underline)) : buttonStyle,);
123121
}
124122

125-
//
126-
// void moveAndUpdateRoute(CrossClipRoutePath path) {
127-
// setNewRoutePath(path);
128-
// }
123+
Widget createDummyNavigator({required Widget child}) => Navigator(
124+
pages: [
125+
MaterialPage(child: child)
126+
],
127+
onPopPage: (_, __) => false,
128+
);
129129

130130
void moveAndUpdateRoute(PortfolioRoutePath path, bool drawer) {
131131
setNewRoutePath(path);

0 commit comments

Comments
 (0)