SOLIDUI: Customised Settings widget on AppBar (#27)#210
SOLIDUI: Customised Settings widget on AppBar (#27)#210Amoghhosamane wants to merge 1 commit intoanusii:devfrom
Conversation
This change adds a settingsWidget parameter to SolidScaffold, allowing developers to define their own settings widget (e.g., an IconButton) which is then displayed in the AppBar next to the About button. It also integrates this widget into the Navigation Rail (trailing) and the Navigation Drawer. Closes anusii#27
4e7c06e to
7d677e2
Compare
There was a problem hiding this comment.
Pull request overview
Adds support for a developer-provided settingsWidget in SolidScaffold, intended to surface a customizable Settings control consistently across the scaffold’s navigation surfaces.
Changes:
- Adds
settingsWidgettoSolidScaffoldand threads it through scaffold builders/helpers. - Renders
settingsWidgetin the AppBar action list (ordered actions), Navigation Rail trailing, and Navigation Drawer content. - Exports
src/utils/path_utils.dartfrom the publicsolidui.dartbarrel.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/src/widgets/solid_scaffold_widget_builder.dart | Passes settingsWidget into AppBar builder and SolidNavDrawer. |
| lib/src/widgets/solid_scaffold_state.dart | Passes settingsWidget into the layout builder for wide-screen nav rail rendering. |
| lib/src/widgets/solid_scaffold_layout_builder.dart | Extends buildBody to accept and forward settingsWidget into SolidNavBar. |
| lib/src/widgets/solid_scaffold_helpers.dart | Extends app bar construction helper to accept/forward settingsWidget. |
| lib/src/widgets/solid_scaffold_appbar_ordered_actions.dart | Adds _addSettingsButton to inject settingsWidget into ordered AppBar actions. |
| lib/src/widgets/solid_scaffold_appbar_builder.dart | Initializes action preferences with hasSettings and forwards settingsWidget into ordered actions builder. |
| lib/src/widgets/solid_scaffold_appbar_actions.dart | Adds “Settings” (preferences ID) to the default/expected AppBar action list when present. |
| lib/src/widgets/solid_scaffold.dart | Introduces the public settingsWidget parameter on SolidScaffold. |
| lib/src/widgets/solid_nav_drawer.dart | Adds settingsWidget support in the drawer UI. |
| lib/src/widgets/solid_nav_bar.dart | Adds settingsWidget as a NavigationRail.trailing widget. |
| lib/solidui.dart | Exports src/utils/path_utils.dart from the public API. |
| example/lib/app_scaffold.dart | Demonstrates passing an IconButton as settingsWidget and navigating to a custom settings subpage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| final isInOverflow = actionConfig?.showInOverflow ?? false; | ||
| final order = actionConfig?.order ?? 850; | ||
|
|
||
| if (isVisible && (!isNarrowScreen || !isInOverflow)) { |
There was a problem hiding this comment.
When the Settings action is configured to show in overflow (showInOverflow = true) on narrow screens, this code hides the settingsWidget from the AppBar but there is no corresponding overflow-menu entry for it, so the Settings control effectively disappears. Consider either forcing Settings to always remain in the AppBar (ignore showInOverflow for this ID), or extend the overflow menu handler to render a Settings item (which may require changing the API from a raw Widget to something that can be represented in a PopupMenuItem).
| if (isVisible && (!isNarrowScreen || !isInOverflow)) { | |
| if (isVisible) { |
| export 'src/utils/is_phone.dart'; | ||
| export 'src/utils/solid_alert.dart'; | ||
| export 'src/utils/solid_notifications.dart'; | ||
| export 'src/utils/path_utils.dart'; |
There was a problem hiding this comment.
This PR’s description is focused on adding a customizable settingsWidget to SolidScaffold, but this change also exports a new public utility (path_utils.dart). If this export is intentional, it should be called out in the PR description/release notes; otherwise consider removing it from this PR to keep the feature-focused scope and avoid an untracked public API surface change.
|
Hi @Amoghhosamane, since PRs #210 and #211 both implement the functionality in #27, could you please merge them into one with their respective branches? Thanks a lot. |
This change adds a settingsWidget parameter to SolidScaffold, allowing developers to define their own settings widget (e.g., an IconButton) which is then displayed in the AppBar next to the About button. It also integrates this widget into the Navigation Rail (trailing) and the Navigation Drawer.
Associated Issue
Type of change
How Has This Been Tested?
Checklist