Skip to content

Commit

Permalink
fix: menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuta1409 committed Mar 15, 2024
1 parent 6ea6597 commit caf89bb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/app_student/.run/main_dev.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="main_dev" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/lib/main_dev.dart" />
<option name="filePath" value="$PROJECT_DIR$/frontend/app_student/lib/main_dev.dart" />
<method v="2" />
</configuration>
</component>
2 changes: 1 addition & 1 deletion frontend/app_student/.run/main_prod.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="main_prod" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/lib/main_prod.dart" />
<option name="filePath" value="$PROJECT_DIR$/frontend/app_student/lib/main_prod.dart" />
<method v="2" />
</configuration>
</component>
19 changes: 18 additions & 1 deletion frontend/app_student/lib/menu/menu_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,24 @@ class MenuBarView extends StatefulWidget {
}

class MenuBarViewState extends State<MenuBarView> {
int _selectedIndex = 0;
int _selectedIndex = 1;

@override
void initState() {
super.initState();
_setSelectedIndex();
}

void _setSelectedIndex() {
final route = GoRouter.of(context).overridePlatformDefaultLocation;
if(route == AppRoutes.loginPage){
_selectedIndex = 0;
} else if(route == AppRoutes.schedulePage){
_selectedIndex = 1;
} else if(route == AppRoutes.profilPage){
_selectedIndex = 2;
}
}

void _onItemTapped(int index) {
setState(() {
Expand Down

0 comments on commit caf89bb

Please sign in to comment.