From 9d1b235472157be63fdf2b831b67dcca90defaeb Mon Sep 17 00:00:00 2001 From: hunteraraujo Date: Fri, 22 Sep 2023 23:24:37 -0700 Subject: [PATCH] Add Settings Tab to SideBarView MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit augments the `SideBarView` by introducing a new `IconButton` that represents a tab for the newly created `SettingsView`. This enhancement allows users to navigate to the settings page directly from the sidebar, improving accessibility to app configuration options. Key Changes: - A new `IconButton` with a settings icon has been added to the sidebar’s `Column` widget. - Selecting the settings tab updates the `selectedViewNotifier.value` to `'SettingsView'`, indicating the user's intent to navigate to the settings page. - Visual feedback is provided by altering the color of the settings icon based on whether the settings tab is currently selected. This addition ensures seamless integration of the `SettingsView` into the existing navigation structure, enabling users to easily configure app settings. --- frontend/lib/views/side_bar/side_bar_view.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/lib/views/side_bar/side_bar_view.dart b/frontend/lib/views/side_bar/side_bar_view.dart index 9fc9e3da..b7545f84 100644 --- a/frontend/lib/views/side_bar/side_bar_view.dart +++ b/frontend/lib/views/side_bar/side_bar_view.dart @@ -35,11 +35,20 @@ class SideBarView extends StatelessWidget { color: selectedView == 'SkillTreeView' ? Colors.blue : Colors.black, - icon: const Icon(Icons.emoji_events), // trophy icon + icon: const Icon(Icons.emoji_events), onPressed: skillTreeViewModel.isBenchmarkRunning ? null : () => selectedViewNotifier.value = 'SkillTreeView', ), + IconButton( + splashRadius: 0.1, + color: selectedView == 'SettingsView' + ? Colors.blue + : Colors.black, + icon: const Icon(Icons.settings), + onPressed: () => + selectedViewNotifier.value = 'SettingsView', + ), ], ), );