EditablePart class

A part that represents an editable input field section.

EditablePart defines a user-editable portion of a formatted input, such as a date component, time segment, or numeric field. Each editable part can have a fixed length, input formatters, and optional obscuring.

Example:

EditablePart(
  length: 2,
  width: 40.0,
  inputFormatters: [FilteringTextInputFormatter.digitsOnly],
  placeholder: Text('MM'),
)
Inheritance

Constructors

EditablePart({required int length, bool obscureText = false, List<TextInputFormatter> inputFormatters = const [], Widget? placeholder, required double width})
Creates an EditablePart with the specified configuration.
const

Properties

canHaveValue bool
Whether this part can hold a value.
no setteroverride
hashCode int
The hash code for this object.
no setteroverride
inputFormatters List<TextInputFormatter>
Input formatters to apply to this part.
final
length int
The maximum length of text this part can hold.
final
obscureText bool
Whether to obscure the text (e.g., for passwords).
final
part InputPart
Returns this part.
no setterinherited
partKey Object?
A unique key identifying this part.
no setteroverride
placeholder Widget?
Optional placeholder widget to display when empty.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value String?
The current value of this part, or null if it doesn't hold a value.
no setterinherited
width double
The width of this input part.
final

Methods

build(BuildContext context, FormattedInputData data) Widget
Builds the widget for this part.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
withValue(String value) FormattedValuePart
Creates a copy of this part with the specified value.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override