Skip to content
On this page

Autocomplete

An editable field with matching suggestions.

Autocomplete in FluttyUIAutocomplete 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.

Autocomplete

const Autocomplete({
  super.key,
  this.size,
  required this.controller,
  required this.options,
  required this.displayStringForOption,
  required this.onSelected,
  this.onChanged,
  this.optionsBuilder,
  this.focusNode,
  this.autofocus = false,
  this.readOnly = false,
  this.autocorrect = true,
  this.textInputAction,
  this.textCapitalization = TextCapitalization.none,
  this.autofillHints,
  this.inputFormatters,
  this.onEditingComplete,
  this.onSubmitted,
  this.placeholder = 'Search...',
  this.backgroundColor,
  this.foregroundColor,
  this.placeholderColor,
  this.borderColor,
  this.focusColor,
  this.borderRadius,
  this.menuBorderRadius,
  this.menuPadding,
  this.maxMenuHeight = 280,
  this.padding,
  this.height,
  this.fontSize,
  this.optionPadding,
  this.optionFontSize,
  this.maxOptions = 6,
  this.enabled = true,
  this.optionBuilder,
});
ParameterTypeRequiredDefault
keyKey?Nonull
sizeComponentSize?Nonull
controllerTextEditingControllerYes—
optionsList<T>Yes—
displayStringForOptionString Function(T option)Yes—
onSelectedValueChanged<T>Yes—
onChangedValueChanged<String>?Nonull
optionsBuilderIterable<T> Function(TextEditingValue value)?Nonull
focusNodeFocusNode?Nonull
autofocusboolNofalse
readOnlyboolNofalse
autocorrectboolNotrue
textInputActionTextInputAction?Nonull
textCapitalizationTextCapitalizationNoTextCapitalization.none
autofillHintsIterable<String>?Nonull
inputFormattersList<TextInputFormatter>?Nonull
onEditingCompleteVoidCallback?Nonull
onSubmittedValueChanged<String>?Nonull
placeholderStringNo'Search...'
backgroundColorColor?Nonull
foregroundColorColor?Nonull
placeholderColorColor?Nonull
borderColorColor?Nonull
focusColorColor?Nonull
borderRadiusdouble?Nonull
menuBorderRadiusdouble?Nonull
menuPaddingEdgeInsetsGeometry?Nonull
maxMenuHeightdoubleNo280
paddingEdgeInsetsGeometry?Nonull
heightdouble?Nonull
fontSizedouble?Nonull
optionPaddingEdgeInsetsGeometry?Nonull
optionFontSizedouble?Nonull
maxOptionsintNo6
enabledboolNotrue
optionBuilderWidget Function(BuildContext context, T option)?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/autocomplete/autocomplete.dart

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

DartFlutter

Get started with FluttyUI