CNSearchScaffold class
A full-screen scaffold with native iOS 26 tab bar and search support.
This widget uses UITabBarController with UISearchController on iOS 26+
to achieve the native liquid glass morphing effect when search is activated.
Unlike CNTabBar, this widget manages the entire screen layout, with Flutter content rendered on top of the native tab bar controller.
Example:
CNSearchScaffold(
items: [
CNSearchScaffoldItem(label: 'Home', icon: CNSymbol('house.fill')),
CNSearchScaffoldItem(label: 'Browse', icon: CNSymbol('square.grid.2x2')),
CNSearchScaffoldItem(label: 'Search', icon: CNSymbol('magnifyingglass'), isSearchTab: true),
],
currentIndex: _index,
onTap: (i) => setState(() => _index = i),
onSearchChanged: (query) => filterResults(query),
children: [
HomePage(),
BrowsePage(),
SearchResultsPage(),
],
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CNSearchScaffold
- Available extensions
Constructors
-
CNSearchScaffold({Key? key, required List<
CNSearchScaffoldItem> items, required int currentIndex, required ValueChanged<int> onTap, required List<Widget> children, Color? tint, Color? unselectedTint, ValueChanged<String> ? onSearchChanged, ValueChanged<String> ? onSearchSubmit, ValueChanged<bool> ? onSearchActiveChanged, String searchPlaceholder = 'Search', CNTabBarSearchController? searchController}) -
Creates a search scaffold with native iOS 26 liquid glass support.
const
Properties
-
children
→ List<
Widget> -
The widget to display for each tab.
Must have the same length as items.
final
- currentIndex → int
-
The index of the currently selected tab.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
items
→ List<
CNSearchScaffoldItem> -
Items to display in the tab bar.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onSearchActiveChanged
→ ValueChanged<
bool> ? -
Called when search active state changes.
final
-
onSearchChanged
→ ValueChanged<
String> ? -
Called when the search text changes.
final
-
onSearchSubmit
→ ValueChanged<
String> ? -
Called when search is submitted.
final
-
onTap
→ ValueChanged<
int> -
Called when a tab is selected.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchController → CNTabBarSearchController?
-
Optional controller for programmatic search management.
final
- searchPlaceholder → String
-
Placeholder text for the search bar.
final
- tint → Color?
-
The tint color for selected items.
final
- unselectedTint → Color?
-
The tint color for unselected items.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< CNSearchScaffold> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
liquidGlass(
{CNGlassEffect effect = CNGlassEffect.regular, CNGlassEffectShape shape = CNGlassEffectShape.capsule, double? cornerRadius, Color? tint, bool interactive = false}) → Widget -
Available on Widget, provided by the LiquidGlassExtension extension
Applies a Liquid Glass effect to this widget. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited