Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
xxfttkx committed Dec 19, 2024
1 parent 6603b39 commit af2ebea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 36 deletions.
23 changes: 1 addition & 22 deletions lib/pages/menu/menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,7 @@ class _BottomMenu extends State<BottomMenu> {
// selectedIndex = index;
// });
state.updateSelectedIndex(index);
switch (index) {
case 0:
{
Modular.to.navigate('/tab/popular/');
}
break;
case 1:
{
Modular.to.navigate('/tab/timeline/');
}
break;
case 2:
{
Modular.to.navigate('/tab/collect/');
}
break;
case 3:
{
Modular.to.navigate('/tab/my/');
}
break;
}
Modular.to.navigate("/tab${menu.getPath(index)}/");
},
);
}),
Expand Down
15 changes: 1 addition & 14 deletions lib/pages/menu/side_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,7 @@ class _SideMenu extends State<SideMenu> {
selectedIndex: state.selectedIndex,
onDestinationSelected: (int index) {
state.updateSelectedIndex(index);
switch (index) {
case 0:
Modular.to.navigate('/tab/popular/');
break;
case 1:
Modular.to.navigate('/tab/timeline/');
break;
case 2:
Modular.to.navigate('/tab/collect/');
break;
case 3:
Modular.to.navigate('/tab/my/');
break;
}
Modular.to.navigate("/tab${menu.getPath(index)}/");
},
),
),
Expand Down

0 comments on commit af2ebea

Please sign in to comment.