CNTabBarNative class
iOS 26+ Native Tab Bar with Search Support
This enables the native iOS 26 tab bar with search functionality. When enabled, it replaces the Flutter app's root with a native UITabBarController, giving you the true iOS 26 liquid glass morphing search effect.
Important: This replaces your app's root view controller. The Flutter content will be displayed within the selected tab.
Example:
@override
void initState() {
super.initState();
CNTabBarNative.enable(
tabs: [
CNTab(title: 'Home', sfSymbol: CNSymbol('house.fill')),
CNTab(title: 'Search', sfSymbol: CNSymbol('magnifyingglass'), isSearchTab: true),
CNTab(title: 'Profile', sfSymbol: CNSymbol('person.fill')),
],
onTabSelected: (index) {
setState(() => _selectedIndex = index);
},
onSearchChanged: (query) {
print('Search query: $query');
},
);
}
@override
void dispose() {
CNTabBarNative.disable();
super.dispose();
}
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
activateSearch(
) → Future< void> - Activate the search (go to search tab and focus search bar)
-
checkIsEnabled(
) → Future< bool> - Check if native tab bar is currently enabled
-
deactivateSearch(
) → Future< void> - Deactivate the search
-
disable(
) → Future< void> - Disable native tab bar and return to Flutter-only mode
-
enable(
{required List< CNTab> tabs, int selectedIndex = 0, void onTabSelected(int index)?, void onSearchChanged(String query)?, void onSearchSubmitted(String query)?, VoidCallback? onSearchCancelled, void onSearchActiveChanged(bool isActive)?, Color? tintColor, Color? unselectedTintColor, bool? isDark}) → Future<void> - Enable native tab bar mode
-
setBadgeCounts(
List< int?> badgeCounts) → Future<void> - Update badge counts for tabs
-
setBrightness(
{required bool isDark}) → Future< void> - Update brightness (dark mode)
-
setSearchText(
String text) → Future< void> - Set the search text programmatically
-
setSelectedIndex(
int index) → Future< void> - Set the selected tab index
-
setStyle(
{Color? tintColor, Color? unselectedTintColor}) → Future< void> - Update style (tint colors)