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.
NbxInputParameters
Immutable configuration class for text input widgets in the Nebux Design System. Groups all parameters needed byNbxTextFieldWidget and NbxTextFormFieldWidget into a single Freezed class.
Overview
NbxInputParameters is built using the Freezed package, providing immutability, copyWith functionality, and built-in equality comparison. It consolidates all input field configuration into one place, making it easier to manage complex input scenarios.
Constructor
Properties
Text Content
Placeholder text shown when the input field is empty. Either
hintText or labelText must be provided.Label text for the input field. Behavior depends on
decorationStyle:outlined: Label appears above the fieldfloating: Label floats inside/above the fieldfilled: Label is not used (only hint is shown)
Required Fields
Whether the field is required. When true,
requiredErrorMessage must be provided.The logical type of input field. Determines keyboard type, input formatters, and validation. Options:
NbxInputType.text- General text inputNbxInputType.free- Free-form with no validationNbxInputType.onlyText- Alphabetic characters onlyNbxInputType.textAndNumbers- Alphanumeric charactersNbxInputType.dropdownMenu- Read-only dropdown styleNbxInputType.alphabet- Alphabetic with spacesNbxInputType.number- Numeric inputNbxInputType.phone- Phone number inputNbxInputType.password- Password (obscured by default)NbxInputType.decimalNumber- Decimal number inputNbxInputType.email- Email address input
Error message shown when required field is empty. Required when
isRequired is true.Validation
Pure validator function that receives input value and returns error message or null. Follows native Flutter validation contract.
Notification callback called with the final error message post-validation. Use for external state management or UI updates. Receives
null when input is valid.When to trigger automatic validation:
AutovalidateMode.always- Validate on every changeAutovalidateMode.onUserInteraction- Validate after first interactionAutovalidateMode.disabled- Never validate automatically
Whether to display error messages below the input field.
Appearance & Behavior
Visual style of the input field:
NbxInputDecorationStyle.outlined- Label above field (requires bothlabelTextandhintText)NbxInputDecorationStyle.floating- Floating label behaviorNbxInputDecorationStyle.filled- Only hint text, no label
How the label should behave when field is focused or has content. Only applicable for floating decoration style.
Whether to obscure text (for passwords). When true, text is masked with bullets.
Whether the field is read-only. When true, keyboard won’t appear but
onTap can still trigger actions.Whether the field is enabled. When false, field appears disabled and cannot be interacted with.
Input Constraints
Minimum number of lines for multiline input. When null, defaults to single line.
Maximum number of lines for multiline input. When null and minLines is set, allows unlimited lines.
Maximum number of characters allowed. When set, can optionally show character counter.
Whether to show a character counter when
maxLength is set.Additional input formatters to apply. These are applied after automatic formatters based on
inputType.Icons & Suffixes
Custom suffix widget to display at the end of the input field. Takes priority over
suffixIconType.Custom prefix widget to display at the start of the input field.
Automatic suffix icon type (ignored when
suffixIcon is provided):NbxSuffixIconType.none- No automatic iconNbxSuffixIconType.eye- Password visibility toggleNbxSuffixIconType.cancel- Clear field button
Callback triggered when suffix icon is pressed.
Visual State
Visual state of the input field:
NbxInputState.neutral- Default stateNbxInputState.success- Valid/success state (green border)NbxInputState.error- Error state (handled by validation)
Supporting text displayed below the input field. Useful for hints or additional context.
Background fill color for the input field. When null, uses theme default.
Border Customization
Default border for all states. When null, uses theme defaults.
Border when field is enabled but not focused.
Border when field is focused.
Border when field has an error.
Border when field is focused and has an error.
Border when field is disabled.
Controller & Callbacks
Custom text editing controller. When null, a controller is created automatically.
Whether to automatically dispose the controller when widget is disposed. Set to false if managing controller lifecycle externally.
The action button to show on the keyboard (done, next, search, etc.).
Callback triggered when user submits input (presses keyboard action button).
Callback triggered every time the input value changes.
Callback triggered when the input field is tapped.
Assertions
The class includes several compile-time assertions to ensure proper configuration:- Required field validation: When
isRequiredis true,requiredErrorMessagemust be provided - Label or hint required: Either
labelTextorhintTextmust be provided - Outlined style requirement: When
decorationStyleisoutlined, bothlabelTextandhintTextmust be provided
Usage Examples
Basic Email Input
Password Input with Visibility Toggle
Multiline Text Area
Custom Validation with State Callback
Read-Only Dropdown Style
Related Documentation
- Text Field Widget - Main text field component documentation
- Input Validation - Validation patterns and best practices
- Form Management - Building forms with Nebux inputs