From eecda3d25d801c8fbafa99f36a19117ce2ddb5c5 Mon Sep 17 00:00:00 2001 From: CGQAQ Date: Mon, 2 Aug 2021 17:20:03 +0800 Subject: [PATCH] Adjusting drawer styling --- lib/views/drawer.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/views/drawer.dart b/lib/views/drawer.dart index d26fe78..273fb2b 100644 --- a/lib/views/drawer.dart +++ b/lib/views/drawer.dart @@ -8,6 +8,7 @@ enum PageIndex { } final _navItems = ["书架", "搜索", "推荐"]; +var _page = _navItems[0]; Drawer mainDrawer( GlobalKey state, ValueChanged onchange) { @@ -42,7 +43,7 @@ Widget _myListTile( return Container( height: 75, decoration: BoxDecoration( - color: Colors.blue[300], + color: _page == text ? Colors.blue[500] : Colors.blue[400], border: Border( bottom: BorderSide( color: Colors.lightBlueAccent, @@ -65,6 +66,7 @@ Widget _myListTile( if (state.currentState.hasDrawer && state.currentState.isDrawerOpen) { Navigator.of(state.currentContext).pop(); } + _page = text; }, child: Container( padding: EdgeInsets.symmetric(vertical: 10),