Skip to content

SOLIDUI: Customised Settings widget on AppBar (#27)#210

Open
Amoghhosamane wants to merge 1 commit intoanusii:devfrom
Amoghhosamane:feature/issue-27-settings-widget
Open

SOLIDUI: Customised Settings widget on AppBar (#27)#210
Amoghhosamane wants to merge 1 commit intoanusii:devfrom
Amoghhosamane:feature/issue-27-settings-widget

Conversation

@Amoghhosamane
Copy link

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Verified using the example application by adding a custom IconButton to the settingsWidget parameter.
  • Confirmed the widget appears in the AppBar, Navigation Rail (trailing), and Navigation Drawer.
  • Verified that the widget correctly navigates to a custom subpage.
  • Ran 'flutter analyze' and confirmed no lint issues were introduced.

Checklist

  • Screenshots included in linked issue SOLIDUI: Customised Settings widget on AppBar #27
  • Changes adhere to the style and coding guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules
  • The update contains no confidential information
  • The update has no duplicated content
  • No lint check errors are related to these changes
  • Integration test output or screenshot included in issue SOLIDUI: Customised Settings widget on AppBar #27
  • I tested the PR on these devices:
    • Android
    • iOS
    • Linux
    • MacOS
    • Windows
    • Web
  • I have identified reviewers
  • The PR has been approved by reviewers

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
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 settingsWidget to SolidScaffold and threads it through scaffold builders/helpers.
  • Renders settingsWidget in the AppBar action list (ordered actions), Navigation Rail trailing, and Navigation Drawer content.
  • Exports src/utils/path_utils.dart from the public solidui.dart barrel.

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)) {
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
if (isVisible && (!isNarrowScreen || !isInOverflow)) {
if (isVisible) {

Copilot uses AI. Check for mistakes.
export 'src/utils/is_phone.dart';
export 'src/utils/solid_alert.dart';
export 'src/utils/solid_notifications.dart';
export 'src/utils/path_utils.dart';
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@tonypioneer
Copy link
Collaborator

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.

@gjwgit gjwgit requested a review from tonypioneer February 20, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants