Skip to content

Support CupertinoSliverNavigationBar.search with condensed large title #159120

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

Merged
merged 75 commits into from
Feb 7, 2025

Conversation

victorsanni
Copy link
Contributor

@victorsanni victorsanni commented Nov 19, 2024

search.animation.mov

Fixes Suggestion: CupertinoSliverNavigationBar allow forcing condensed title
Fixes Expose search field in CupertinoSliverNavigationBar.search

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. f: cupertino flutter/packages/flutter/cupertino repository d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos labels Nov 19, 2024
Copy link
Contributor

@MitchellGoodwin MitchellGoodwin left a comment

Choose a reason for hiding this comment

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

Uploading Screen Recording 2024-11-19 at 10.49.22 AM.mov…

Looking at the settings app, the content will fade in and out during the search transition as well. To enable coordinating the two transitions, ideally they both would use the same animation controller. So I wonder if we should either: Make the animation controller of the sliver navbar public so it can be accessed, or accept an animation controller in the constructor so it can be passed down from the context around it? I think I'd lean towards the former option.

Also, are we planning to do something similar with the non-sliver navbar?

@@ -1044,6 +1046,10 @@ class CupertinoSliverNavigationBar extends StatefulWidget {
/// Defaults to [NavigationBarBottomMode.automatic] if this is null and a [bottom] is provided.
final NavigationBarBottomMode? bottomMode;

/// Callback called when the search field in [CupertinoSliverNavigationBar.search]
/// is focused or unfocused.
final ValueChanged<bool>? onSearchFocused;
Copy link
Contributor

Choose a reason for hiding this comment

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

For the final version, we probably don't want to refer to it as onSearchFocused. Focused suggests it triggers when a keyboard navigates to it, which is probably not what we want. Maybe onSearchActive?

@victorsanni
Copy link
Contributor Author

So I wonder if we should either: Make the animation controller of the sliver navbar public so it can be accessed, or accept an animation controller in the constructor so it can be passed down from the context around it? I think I'd lean towards the former option.

Thinking the former as well. This implementation also replaces the initial search field with a new interactive one. I'm thinking we also add that as a property? Maybe activeSearchField? It will be confusing though because a user might customize it expecting the initial search field to be customized as well. Or should I figure out a way to make it always use the same search field?

Also, are we planning to do something similar with the non-sliver navbar?

I doubt it. Since in the non-sliver version we don't provide a .search affordance. The user has unrestricted control on what the bottom widget should be, and the ability to change the nav bar as required to match it.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 17, 2025
auto-submit bot pushed a commit that referenced this pull request Feb 20, 2025
…d large title (#162912)

Original PR: #159120

The next stable branch has `CupertinoSliverNavigationBar.search`, but it is currently [unusable](#159120 (comment)). The linked PR adds the search functionality and makes it usable.
CodixNinja pushed a commit to CodixNinja/flutter that referenced this pull request May 15, 2025
…d large title (#162912)

Original PR: flutter/flutter#159120

The next stable branch has `CupertinoSliverNavigationBar.search`, but it is currently [unusable](flutter/flutter#159120 (comment)). The linked PR adds the search functionality and makes it usable.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cp: beta cherry pick this pull request to beta release candidate branch d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: cupertino flutter/packages/flutter/cupertino repository f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
6 participants