CNToolbarSearch class

The search field of a window toolbar (NSSearchToolbarItem, macOS).

It shrinks to a magnifying-glass button when the window is narrow, and opens again when clicked. Esc clears the text, then ends the search and hands the keyboard back to Flutter.

iOS has no search field in a bottom toolbar: there the item is left out. Use CNSearchBar or CNSearchScaffold on iOS.

Inheritance

Constructors

CNToolbarSearch({String? id, String label = 'Search', String? placeholder, String? text, double? width, CNTabBarSearchController? controller, ValueChanged<String>? onChanged, ValueChanged<String>? onSubmitted, ValueChanged<bool>? onActiveChanged})
Creates a toolbar search field.
const

Properties

controller → CNTabBarSearchController?
Starts or ends the search and sets its text from code; it also follows what the user types.
final
hashCode → int
The hash code for this object.
no setterinherited
id → String?
Identifies the item across rebuilds, so a change updates the native item in place. Unique within a toolbar. Without one, an item is known by its kind and its position among the items of that kind.
finalinherited
label → String
The name of the field, for VoiceOver and the overflow menu.
final
onActiveChanged → ValueChanged<bool>?
Called with true when the field starts editing and false when it stops.
final
onChanged → ValueChanged<String>?
Called on every change of the text.
final
onSubmitted → ValueChanged<String>?
Called when the user presses Return.
final
placeholder → String?
Text shown in the empty field; label when null.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
text → String?
Sets the field's text whenever it changes here. Null leaves the text to the user (and to controller).
final
width → double?
The width the field prefers when there is room, in points.
final

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