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

CNTabBarNative()

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 Properties

isEnabled bool
Whether the native tab bar is currently enabled.
no setter

Static Methods

activateSearch() Future<void>
Navigates to the search tab and focuses the search field.
checkIsEnabled() Future<bool>
Returns true if the native tab bar is currently active on the platform side.
deactivateSearch() Future<void>
Dismisses the search bar and returns to the previously selected tab.
disable() Future<void>
Disables the native tab bar and restores 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>
Updates badge counts for each tab.
setBrightness({required bool isDark}) Future<void>
Notifies the native tab bar of a light/dark mode change.
setSearchText(String text) Future<void>
Sets the search field text to text without triggering the keyboard.
setSelectedIndex(int index) Future<void>
Selects the tab at index in the native tab bar.
setStyle({Color? tintColor, Color? unselectedTintColor}) Future<void>
Updates the tint colors of the native tab bar.