MacosSearchField<T> class
A macOS-style search field.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MacosSearchField
Constructors
-
MacosSearchField({Key? key, List<
SearchResultItem> ? results, dynamic onResultSelected(SearchResultItem)?, int maxResultsToShow = 5, double resultHeight = _kResultHeight, Widget emptyWidget = const SizedBox.shrink(), TextEditingController? controller, FocusNode? focusNode, BoxDecoration? decoration = kDefaultRoundedBorderDecoration, BoxDecoration? focusedDecoration = kDefaultFocusedBorderDecoration, EdgeInsets padding = const EdgeInsets.all(4.0), String? placeholder = "Search", TextStyle? placeholderStyle = const TextStyle(fontWeight: FontWeight.w400, color: CupertinoColors.placeholderText), TextStyle? style, TextAlign textAlign = TextAlign.start, bool autocorrect = true, bool autofocus = false, int? maxLines, int? minLines, bool expands = false, int? maxLength, MaxLengthEnforcement? maxLengthEnforcement, ValueChanged<String> ? onChanged, List<TextInputFormatter> ? inputFormatters, bool? enabled = true, GestureTapCallback? onTap}) -
Creates a macOS-style search field.
const
Properties
- autocorrect → bool
-
Whether to enable autocorrection.
final
- autofocus → bool
-
Whether this text field should focus itself if nothing else is already
focused.
final
- controller → TextEditingController?
-
Specifies the
TextEditingController
for MacosSearchField.final - decoration → BoxDecoration?
-
Controls the BoxDecoration of the box behind the text input.
final
- emptyWidget → Widget
-
Widget to show when the search returns no results.
final
- enabled → bool?
-
Disables the text field when false.
final
- expands → bool
-
Whether this widget's height will be sized to fill its parent.
final
- focusedDecoration → BoxDecoration?
-
Controls the BoxDecoration of the box behind the text input when focused.
This decoration is drawn above decoration.
final
- focusNode → FocusNode?
-
An optional focus node to use as the focus node for this widget.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
inputFormatters
→ List<
TextInputFormatter> ? -
Optional input validation and formatting overrides.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maxLength → int?
-
The maximum number of characters (Unicode scalar values) to allow in the
text field.
final
- maxLengthEnforcement → MaxLengthEnforcement?
-
Determines how the maxLength limit should be enforced.
final
- maxLines → int?
-
The maximum number of lines to show at one time, wrapping if necessary.
final
- maxResultsToShow → int
-
Specifies the number of results that will be displayed.
final
- minLines → int?
-
The minimum number of lines to occupy when the content spans fewer lines.
final
-
onChanged
→ ValueChanged<
String> ? -
Use this to get the current search query of the MacosSearchField.
final
- onResultSelected → dynamic Function(SearchResultItem)?
-
The action to perform when any suggestion is selected.
final
- onTap → GestureTapCallback?
-
Called for the first tap in a series of taps.
final
- padding → EdgeInsets
-
Padding around the text entry area.
final
- placeholder → String?
-
A lighter colored placeholder hint that appears on the first line of the
text field when the text entry is empty.
final
- placeholderStyle → TextStyle?
-
The style to use for the placeholder text.
final
- resultHeight → double
-
Specifies the height of each suggestion item in the list.
final
-
results
→ List<
SearchResultItem> ? -
List of results for the searchfield.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → TextStyle?
-
The style to use for the text being edited.
final
- textAlign → TextAlign
-
How the text should be aligned horizontally.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MacosSearchField< T> > -
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
-
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}) → 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