-
Notifications
You must be signed in to change notification settings - Fork 2
SOLIDUI: Customised Settings widget on AppBar (#27) #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -58,6 +58,7 @@ class SolidAppBarOrderedActionsBuilder { | |||||
| required VoidCallback? themeToggleCallback, | ||||||
| required SolidAboutConfig aboutConfig, | ||||||
| required BuildContext context, | ||||||
| Widget? settingsWidget, | ||||||
| void Function(BuildContext)? onLogout, | ||||||
| void Function(BuildContext)? onLogin, | ||||||
| }) { | ||||||
|
|
@@ -76,6 +77,7 @@ class SolidAppBarOrderedActionsBuilder { | |||||
| _addCustomActions(orderedActions, config, screenWidth, isNarrowScreen); | ||||||
| _addOverflowItems(orderedActions, config, isNarrowScreen); | ||||||
| _addAuthButton(orderedActions, onLogout, onLogin, isNarrowScreen, context); | ||||||
| _addSettingsButton(orderedActions, settingsWidget, isNarrowScreen); | ||||||
| _addAboutButton( | ||||||
| orderedActions, | ||||||
| aboutConfig, | ||||||
|
|
@@ -220,6 +222,27 @@ class SolidAppBarOrderedActionsBuilder { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| static void _addSettingsButton( | ||||||
| List<_OrderedAction> orderedActions, | ||||||
| Widget? settingsWidget, | ||||||
| bool isNarrowScreen, | ||||||
| ) { | ||||||
| if (settingsWidget == null) return; | ||||||
|
|
||||||
| final actionConfig = SolidAppBarActionsManager.getActionConfig( | ||||||
| SolidAppBarActionIds.preferences, | ||||||
| ); | ||||||
| final isVisible = actionConfig?.isVisible ?? true; | ||||||
| final isInOverflow = actionConfig?.showInOverflow ?? false; | ||||||
| final order = actionConfig?.order ?? 850; | ||||||
|
|
||||||
| if (isVisible && (!isNarrowScreen || !isInOverflow)) { | ||||||
|
||||||
| if (isVisible && (!isNarrowScreen || !isInOverflow)) { | |
| if (isVisible) { |
There was a problem hiding this comment.
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.