@@ -31,29 +31,27 @@ class PortfolioRouterDelegate extends RouterDelegate<PortfolioRoutePath>
31
31
32
32
@override
33
33
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
+ )
57
55
),
58
56
);
59
57
}
@@ -122,10 +120,12 @@ class PortfolioRouterDelegate extends RouterDelegate<PortfolioRoutePath>
122
120
return Text (subject, style: isCurrent ? buttonStyle.merge (TextStyle (decoration: TextDecoration .underline)) : buttonStyle,);
123
121
}
124
122
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
+ );
129
129
130
130
void moveAndUpdateRoute (PortfolioRoutePath path, bool drawer) {
131
131
setNewRoutePath (path);
0 commit comments