Package selection guidance compiled from public package information, community data, and project usage.
A Flutter package that extends AppBar functionality to seamlessly switch between a standard app bar and a search field. It provides a clean, interactive way to toggle between navigation and search modes within the app bar, enhancing user experience in apps with frequent search interactions. The package is lightweight and integrates easily into existing UIs. It supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux.
Use cases
Implementing dynamic search bars in mobile and web apps
Creating intuitive navigation with on-demand search
Enhancing user experience in content-heavy applications
Building responsive interfaces with minimal UI changes
Enabling quick access to search from the top app bar
Key features
One-click toggle between app bar and search mode
Customizable search field appearance
Supports platform-specific behaviors
Lightweight and easy to integrate
Built-in animations for smooth transitions
Suitable for
Developers building apps with frequent search needs
UI designers seeking elegant search integration
Cross-platform app developers targeting multiple operating systems
Set value of this ValueNotifier to true to show Search AppBar,
(Note: currently, if you stop search via this variable(by setting it false), clearOnClose will not work, and callBack onClose will not be called), so use GlobalKey if you need them.
How to make android back button close search? (instead of going to previous screen or exit app)
Initialise variable searchText and isSearchMode of type ValueNotifier somewhere up in the widget tree,
... // inside a widget@overrideWidgetbuild(BuildContext context) {
returnScaffold(
appBar: AppBarWithSearchSwitch(
title: (context) {
returnAutocomplete<String>(
optionsBuilder: (TextEditingValue textEditingValue) {
// your code here
},
);
}
appBarBuilder: (context) {
returnAppBar(
... // you code here
Can it be used with old flutter sdk versions?
The release 1.3.5 is a special release with support of old flutter sdk, it tested with flutter 2.10.0
Known issues
FIXED UPSTREAMkeepAppBarColors = true didn't change color of 'Text Selection Handles' (selection bubbles), this is because of
upstream issue https://github.com/flutter/flutter/issues/74890 with textSelectionTheme: selectionHandleColor