Skip to content

Commit

Permalink
fix: get current route for menu
Browse files Browse the repository at this point in the history
  • Loading branch information
julesartd committed Mar 15, 2024
1 parent 14e9231 commit 6433bee
Show file tree
Hide file tree
Showing 3 changed files with 6 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$/frontend/app_student/lib/main_dev.dart" />
<option name="filePath" value="$PROJECT_DIR$/lib/main_dev.dart" />
<method v="2" />
</configuration>
</component>
5 changes: 4 additions & 1 deletion frontend/app_student/lib/menu/menu_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ class MenuBarViewState extends State<MenuBarView> {
_setSelectedIndex();
}



void _setSelectedIndex() {
final route = GoRouter.of(context).overridePlatformDefaultLocation;
final route = GoRouter.of(context).routeInformationProvider.value.uri.path;

if (route == AppRoutes.loginPage) {
_selectedIndex = 0;
} else if (route == AppRoutes.schedulePage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class WeekSchedulePage extends StatelessWidget {
}
},
),
bottomNavigationBar: const MenuBarView(),
bottomNavigationBar: MenuBarView(),
),
),
);
Expand Down

0 comments on commit 6433bee

Please sign in to comment.