Skip to content

Commit 9a74768

Browse files
committed
fix the overlay error for the drawer tooltip
Signed-off-by: Tejas Mehta <[email protected]>
1 parent d8e0289 commit 9a74768

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class MyApp extends StatelessWidget {
2525
);
2626
final ThemeData _darkTheme = ThemeData(
2727
brightness: Brightness.dark,
28-
scaffoldBackgroundColor: Colors.black,
28+
// scaffoldBackgroundColor: Colors.black,
2929
appBarTheme: AppBarTheme(color: Colors.transparent, shadowColor: Colors.transparent, iconTheme: IconThemeData(color: Colors.white)),
3030
textTheme: TextTheme(headline4: TextStyle(fontWeight: FontWeight.bold, color: Colors.white), bodyText2: TextStyle(fontSize: 16, height: 1.75, color: Colors.grey.shade200)),
3131
);

lib/routing/portfolio_router_delegate.dart

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,26 @@ class PortfolioRouterDelegate extends RouterDelegate<PortfolioRoutePath>
3434
return PortfolioRouteControllerWidget(
3535
initialRoute: _currentPage.path,
3636
delegate: this,
37-
child: Scaffold(
38-
key: _scaffoldKey,
39-
appBar: _createAppbar(context),
40-
drawer: MediaQuery.of(context).size.width <= 500 ? _createDrawer(context) : null,
41-
body: Navigator(
42-
key: navigatorKey,
43-
pages: [
44-
_getPathForRoute(_currentPage)
45-
],
46-
onPopPage: (route, result) {
47-
if (!route.didPop(result)) return false;
48-
_currentPage.removeFragment();
49-
notifyListeners();
50-
return true;
51-
},
52-
),
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+
],
5357
),
5458
);
5559
}

0 commit comments

Comments
 (0)