Skip to content
On this page

SearchField

A text input designed for search queries.

SearchField in FluttyUISearchField in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

SearchField

const SearchField({
  super.key,
  this.size,
  required this.controller,
  this.onChanged,
  this.onSubmitted,
  this.onClear,
  this.suggestions,
  this.onSuggestionSelected,
  this.focusNode,
  this.readOnly = false,
  this.autocorrect = true,
  this.textInputAction,
  this.textCapitalization = TextCapitalization.none,
  this.autofillHints,
  this.inputFormatters,
  this.onEditingComplete,
  this.hintText = 'Search...',
  this.backgroundColor,
  this.foregroundColor,
  this.hintColor,
  this.borderColor,
  this.focusColor,
  this.borderRadius,
  this.menuBorderRadius,
  this.menuPadding,
  this.maxMenuHeight = 280,
  this.padding,
  this.height,
  this.fontSize,
  this.optionPadding,
  this.optionFontSize,
  this.showClearButton = true,
  this.showShadow = true,
  this.autofocus = false,
  this.enabled = true,
  this.maxSuggestions = 6,
  this.suggestionBuilder,
});
ParameterTypeRequiredDefault
keyKey?Nonull
sizeComponentSize?Nonull
controllerTextEditingControllerYes—
onChangedValueChanged<String>?Nonull
onSubmittedValueChanged<String>?Nonull
onClearVoidCallback?Nonull
suggestionsList<T>?Nonull
onSuggestionSelectedValueChanged<T>?Nonull
focusNodeFocusNode?Nonull
readOnlyboolNofalse
autocorrectboolNotrue
textInputActionTextInputAction?Nonull
textCapitalizationTextCapitalizationNoTextCapitalization.none
autofillHintsIterable<String>?Nonull
inputFormattersList<TextInputFormatter>?Nonull
onEditingCompleteVoidCallback?Nonull
hintTextStringNo'Search...'
backgroundColorColor?Nonull
foregroundColorColor?Nonull
hintColorColor?Nonull
borderColorColor?Nonull
focusColorColor?Nonull
borderRadiusdouble?Nonull
menuBorderRadiusdouble?Nonull
menuPaddingEdgeInsetsGeometry?Nonull
maxMenuHeightdoubleNo280
paddingEdgeInsetsGeometry?Nonull
heightdouble?Nonull
fontSizedouble?Nonull
optionPaddingEdgeInsetsGeometry?Nonull
optionFontSizedouble?Nonull
showClearButtonboolNotrue
showShadowboolNotrue
autofocusboolNofalse
enabledboolNotrue
maxSuggestionsintNo6
suggestionBuilderWidget Function(BuildContext context, T suggestion)?Nonull

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/forms/search_field/search_field.dart

This reference is generated from the SearchField declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI