Documentation Index
Fetch the complete documentation index at: https://synapsync.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
NbxTextFieldWidget is a text input component designed for standalone use cases that don’t require Form integration. It’s ideal for search fields, filters, or simple inputs that manage their own state via onChanged callbacks.
For Form-integrated validation, use NbxTextFormFieldWidget instead.
Basic Usage
Widget Properties
The configuration parameters for this text field. All customization is done through this parameter object.
NbxInputParameters
Immutable configuration object that groups all parameters needed by text input widgets.Required Parameters
Whether the field is required. If true,
requiredErrorMessage must also be provided.The logical type of the input field, determines keyboard type, input formatters, and validation behavior.
Text Labels
Placeholder text shown when the field is empty. Either
hintText or labelText must be provided.Label text for the input field. Either
hintText or labelText must be provided.Supporting text displayed below the input field.
Input Behavior
Whether to obscure the text (for password fields).
Whether the field is read-only.
Whether the field is enabled.
Whether to automatically dispose the controller when the widget is disposed.
Input Constraints
Minimum number of lines for the input field.
Maximum number of lines for the input field.
Maximum number of characters allowed.
Validation
Error message to display when required field is empty. Required if
isRequired is true.Pure validator function that receives input value and returns error message or null.
Notification callback called with the final error post-validation (null means valid).
When to trigger validation automatically.
Whether to show error text below the input field.
Styling and Decoration
Visual style of the input field decoration.
Visual state of the input field (neutral, success, error).
Custom suffix widget - takes priority over
suffixIconType.Widget displayed at the start of the input field.
Automatic suffix icon type. Ignored when
suffixIcon is provided.Background fill color for the input field.
How the label should behave when the field gains focus.
Border Customization
Default border for the input field.
Border when the field is enabled.
Border when the field has focus.
Border when the field has an error.
Border when the field has an error and focus.
Border when the field is disabled.
Callbacks
Called whenever the text changes.
Called when the user submits the field.
Called when the input field is tapped.
Called when the suffix icon is pressed.
Other Properties
Controller for the text input. If not provided, one will be created automatically.
The type of action button to use for the keyboard.
Input formatters to apply to the text.
Whether to show a character counter when
maxLength is set.NbxInputType Enum
Defines the logical type of input field:NbxInputType.text- General text inputNbxInputType.free- Free-form input with no validationNbxInputType.onlyText- Alphabetic characters onlyNbxInputType.textAndNumbers- Alphanumeric charactersNbxInputType.dropdownMenu- Read-only dropdown-style inputNbxInputType.alphabet- Alphabetic characters with spacesNbxInputType.number- Numeric inputNbxInputType.phone- Phone number inputNbxInputType.password- Password input (obscured by default)NbxInputType.decimalNumber- Decimal number inputNbxInputType.email- Email address input
NbxInputDecorationStyle Enum
Defines the visual appearance of the input field:NbxInputDecorationStyle.floating- Label appears inside and floats above when focusedNbxInputDecorationStyle.outlined- Label appears above the input fieldNbxInputDecorationStyle.filled- Only hint text is shown, no label
NbxSuffixIconType Enum
Automatic suffix icon types:NbxSuffixIconType.none- No automatic suffix iconNbxSuffixIconType.eye- Toggles password visibilityNbxSuffixIconType.cancel- Clears the input field content
NbxInputState Enum
Visual state of the input field:NbxInputState.neutral- Default state with no indicatorsNbxInputState.success- Valid field with success borderNbxInputState.error- Field has errors
Examples
Basic Text Field
Search Field
Email Input
Password Field
Multiline Text Area
See Also
- NbxTextFormFieldWidget - For Form-integrated inputs
- NbxPhoneFieldWidget - For phone number inputs
- NbxInputParameters