InputFeatureVisibility class abstract
Abstract base class for controlling input feature visibility.
Defines when UI elements like clear buttons, password toggles, or other input features should be visible based on text field state. Supports logical operations (AND, OR, NOT) to combine multiple visibility conditions.
Example:
// Show clear button when text is not empty and field is focused
final visibility = InputFeatureVisibility.textNotEmpty &
InputFeatureVisibility.focused;
Constructors
- InputFeatureVisibility()
-
Creates an InputFeatureVisibility.
const
-
InputFeatureVisibility.and(Iterable<
InputFeatureVisibility> features) -
Creates a visibility condition that is true when all
featuresare true.constfactory - InputFeatureVisibility.not(InputFeatureVisibility feature)
-
Creates a visibility condition that inverts the given
feature.constfactory -
InputFeatureVisibility.or(Iterable<
InputFeatureVisibility> features) -
Creates a visibility condition that is true when any
featuresis true.constfactory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
and(
InputFeatureVisibility other) → InputFeatureVisibility -
Combines this visibility with
otherusing logical AND. -
canShow(
TextFieldState state) → bool - Checks if the feature can be shown in the current state.
-
getDependencies(
TextFieldState state) → Iterable< Listenable> - Gets the listenable dependencies for this visibility condition.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
or(
InputFeatureVisibility other) → InputFeatureVisibility -
Combines this visibility with
otherusing logical OR. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator &(
InputFeatureVisibility other) → InputFeatureVisibility - Operator form of and. Combines conditions with logical AND.
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator |(
InputFeatureVisibility other) → InputFeatureVisibility - Operator form of or. Combines conditions with logical OR.
-
operator ~(
) → InputFeatureVisibility - Inverts this visibility condition using logical NOT.
Constants
- always → const InputFeatureVisibility
- Visibility condition: always visible.
- focused → const InputFeatureVisibility
- Visibility condition: text field has focus.
- hasSelection → const InputFeatureVisibility
- Visibility condition: text field has selected text.
- hovered → const InputFeatureVisibility
- Visibility condition: text field is being hovered.
- never → const InputFeatureVisibility
- Visibility condition: never visible.
- textEmpty → const InputFeatureVisibility
- Visibility condition: text field is empty.
- textNotEmpty → const InputFeatureVisibility
- Visibility condition: text field is not empty.