Add Settings Tab to SideBarView

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.
This commit is contained in:
hunteraraujo
2023-09-22 23:24:37 -07:00
parent 20b40061e2
commit 9d1b235472

View File

@@ -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',
),
],
),
);