Skip to content
On this page

TextField

A text field with label, description, and validation support.

TextField in FluttyUITextField 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.

TextField

const TextField({
  super.key,
  this.size,
  this.controller,
  this.focusNode,
  this.initialValue,
  this.onChanged,
  this.onSubmitted,
  this.hintText,
  this.label,
  this.description,
  this.errorText,
  this.prefix,
  this.suffix,
  this.enabled = true,
  this.readOnly = false,
  this.obscureText = false,
  this.autofocus = false,
  this.keyboardType = TextInputType.text,
  this.textInputAction,
  this.textCapitalization = TextCapitalization.none,
  this.textAlign = TextAlign.start,
  this.maxLines = 1,
  this.minLines,
  this.maxLength,
  this.maxLengthEnforcement = MaxLengthEnforcement.enforced,
  this.inputFormatters,
  this.autofillHints,
  this.showCounter = false,
  this.padding,
  this.borderRadius,
  this.borderWidth = 1,
  this.fontSize,
  this.labelFontSize,
  this.descriptionFontSize,
  this.color,
  this.textColor,
  this.hintColor,
  this.labelColor,
  this.descriptionColor,
  this.borderColor,
  this.focusedBorderColor,
  this.errorColor,
  this.cursorColor,
  this.enabledOpacity = 1,
  this.onEditingComplete,
});
ParameterTypeRequiredDefault
keyKey?Nonull
sizeComponentSize?Nonull
controllerTextEditingController?Nonull
focusNodeFocusNode?Nonull
initialValueString?Nonull
onChangedValueChanged<String>?Nonull
onSubmittedValueChanged<String>?Nonull
hintTextString?Nonull
labelString?Nonull
descriptionString?Nonull
errorTextString?Nonull
prefixWidget?Nonull
suffixWidget?Nonull
enabledboolNotrue
readOnlyboolNofalse
obscureTextboolNofalse
autofocusboolNofalse
keyboardTypeTextInputTypeNoTextInputType.text
textInputActionTextInputAction?Nonull
textCapitalizationTextCapitalizationNoTextCapitalization.none
textAlignTextAlignNoTextAlign.start
maxLinesint?No1
minLinesint?Nonull
maxLengthint?Nonull
maxLengthEnforcementMaxLengthEnforcementNoMaxLengthEnforcement.enforced
inputFormattersList<TextInputFormatter>?Nonull
autofillHintsIterable<String>?Nonull
showCounterboolNofalse
paddingEdgeInsetsGeometry?Nonull
borderRadiusdouble?Nonull
borderWidthdoubleNo1
fontSizedouble?Nonull
labelFontSizedouble?Nonull
descriptionFontSizedouble?Nonull
colorColor?Nonull
textColorColor?Nonull
hintColorColor?Nonull
labelColorColor?Nonull
descriptionColorColor?Nonull
borderColorColor?Nonull
focusedBorderColorColor?Nonull
errorColorColor?Nonull
cursorColorColor?Nonull
enabledOpacitydoubleNo1
onEditingCompleteVoidCallback?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/text_field/text_field.dart

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

DartFlutter

Get started with FluttyUI