Skip to content

Commit

Permalink
Merge pull request #490 from xxfttkx/branch-fix-time
Browse files Browse the repository at this point in the history
simplify code
  • Loading branch information
Predidit authored Dec 19, 2024
2 parents 6603b39 + af2ebea commit 0abc3b1
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 0abc3b1

Please sign in to comment.