VirtualKeypadTextField class

A text field that integrates with VirtualKeypad through VirtualKeypadScope.

By default, prevents the system keyboard from appearing while maintaining full cursor and selection functionality. Use allowPhysicalKeyboard to enable both physical and virtual keyboard input.

VirtualKeypadScope(
  child: Column(
    children: [
      VirtualKeypadTextField(
        controller: controller,
        decoration: InputDecoration(labelText: 'Password'),
        obscureText: true,
      ),
      VirtualKeypad(),
    ],
  ),
)
Inheritance

Constructors

VirtualKeypadTextField({Key? key, required VirtualKeypadController controller, InputDecoration? decoration, TextStyle? style, int? maxLength, bool obscureText = false, String obscuringCharacter = '•', bool enabled = true, bool readOnly = false, bool autofocus = false, TextAlign textAlign = TextAlign.start, TextAlignVertical? textAlignVertical, int? maxLines = 1, int? minLines, ValueChanged<String>? onChanged, VoidCallback? onTap, ValueChanged<String>? onSubmitted, void onInputAction(KeyAction action, String text)?, bool allowPhysicalKeyboard = false, KeyboardType keyboardType = KeyboardType.text, TextInputAction? textInputAction})
Creates a text field optimized for virtual keyboard input.
const

Properties

allowPhysicalKeyboard bool
Whether to allow physical keyboard input alongside virtual keyboard.
final
autofocus bool
Whether to automatically focus when the widget is created.
final
controller VirtualKeypadController
Controller for the text field's content and selection.
final
decoration InputDecoration?
Decoration for the text field (border, label, hint, etc.).
final
enabled bool
Whether the text field accepts input.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType KeyboardType
The type of virtual keyboard to display.
final
maxLength int?
Maximum number of characters allowed.
final
maxLines int?
Maximum number of lines for the text field.
final
minLines int?
Minimum number of lines for the text field.
final
obscureText bool
Whether to hide the text (for passwords).
final
obscuringCharacter String
Character used when obscureText is true.
final
onChanged ValueChanged<String>?
Called when the text content changes.
final
onInputAction → void Function(KeyAction action, String text)?
Called when a submit-like keyboard action is triggered.
final
onSubmitted ValueChanged<String>?
Called when the user submits (e.g., presses enter/done).
final
onTap VoidCallback?
Called when the text field is tapped.
final
readOnly bool
Whether the text field is read-only.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style TextStyle?
Text style for the input text.
final
textAlign TextAlign
How to align the text horizontally.
final
textAlignVertical TextAlignVertical?
How to align the text vertically within the field.
final
textInputAction TextInputAction?
The action button to show on the keyboard (done, next, search, etc.).
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<VirtualKeypadTextField>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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