MinInput class

Campo de entrada de texto personalizado del sistema de diseño Min.

Admite distintos tipos semánticos (MinInputType), variantes de error (MinInputVariant), íconos/widgets laterales, altura fija o dinámica, un mensaje de error debajo del campo y estilos visuales intercambiables mediante MinInputStyle.

Variantes de estilo predefinidas

MinInput(style: MinInputStyle.outline(context.theme))  // defecto
MinInput(style: MinInputStyle.filled(context.theme))
MinInput(style: MinInputStyle.ghost(context.theme))
MinInput(style: MinInputStyle.underline(context.theme))

Estilo completamente personalizado

MinInput(
  style: MinInputStyle(
    idle: BoxDecoration(color: Colors.blue.shade50, ...),
    focused: BoxDecoration(...),
    error: BoxDecoration(...),
    disabled: BoxDecoration(...),
  ),
)

Ejemplo básico

MinInput(
  placeholder: 'Correo electrónico',
  type: MinInputType.email,
  onChanged: (value) => print(value),
)
Inheritance

Constructors

MinInput({Key? key, TextEditingController? controller, FocusNode? focusNode, String? placeholder, Widget? leading, Widget? trailing, String? errorText, bool enabled = true, bool readOnly = false, bool autofocus = false, MinInputType type = MinInputType.text, MinInputVariant variant = MinInputVariant.normal, MinInputStyle? style, TextInputType? keyboardType, TextInputAction? textInputAction, TextCapitalization textCapitalization = TextCapitalization.none, int? maxLines, int? minLines, int? maxLength, bool? obscureText, ValueChanged<String>? onChanged, ValueChanged<String>? onSubmitted, VoidCallback? onEditingComplete, List<TextInputFormatter>? inputFormatters, bool? autocorrect, bool enableSuggestions = true, double? height, EdgeInsets contentPadding = const EdgeInsets.symmetric(horizontal: 12, vertical: 8), bool showCounter = false, String? semanticLabel})
const

Properties

autocorrect bool?
Si null, usa el valor por defecto de Flutter (true en texto, false en contraseña/email). Sobreescribir para control explícito.
final
autofocus bool
Si true, el campo solicita el foco automáticamente al insertarse.
final
contentPadding EdgeInsets
Espaciado interno entre el borde y el contenido editable.
final
controller TextEditingController?
Controlador del texto. Si es null se crea uno interno.
final
enabled bool
Si false, el campo queda visualmente atenuado y no acepta entrada.
final
enableSuggestions bool
Habilita las sugerencias de palabras del teclado.
final
errorText String?
Mensaje de error que aparece debajo del campo cuando hay un problema.
final
focusNode FocusNode?
Nodo de foco. Si es null se crea uno interno.
final
hashCode int
The hash code for this object.
no setterinherited
height double?
Altura fija del área de entrada (en píxeles lógicos).
final
inputFormatters List<TextInputFormatter>?
Formateadores que procesan la entrada antes de que se aplique al texto.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType TextInputType?
Tipo de teclado. Sobreescribe el valor derivado de type si se especifica.
final
leading Widget?
Widget que se ubica al inicio (izquierda) del campo, dentro del borde.
final
maxLength int?
Longitud máxima de caracteres permitida.
final
maxLines int?
Número máximo de líneas visibles.
final
minLines int?
Número mínimo de líneas visibles (solo relevante en multilínea).
final
obscureText bool?
Si true, oculta el texto (modo contraseña).
final
onChanged ValueChanged<String>?
Llamado cada vez que el texto cambia.
final
onEditingComplete VoidCallback?
Llamado cuando la edición finaliza (antes de onSubmitted).
final
onSubmitted ValueChanged<String>?
Llamado cuando el usuario presiona la acción del teclado (e.g. "done").
final
placeholder String?
Texto de marcador de posición que se muestra cuando el campo está vacío.
final
readOnly bool
Si true, el campo muestra el texto pero no permite editarlo.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel String?
Etiqueta de accesibilidad del campo.
final
showCounter bool
Si es true y se especifica maxLength, muestra un contador de caracteres debajo del campo, alineado a la derecha. No tapa el texto escrito.
final
style MinInputStyle?
Estilo visual del campo. Controla la BoxDecoration de cada estado (reposo, foco, error, deshabilitado).
final
textCapitalization TextCapitalization
Capitalización automática del texto introducido.
final
textInputAction TextInputAction?
Acción del botón de acción del teclado. Sobreescribe el valor de type.
final
trailing Widget?
Widget que se ubica al final (derecha) del campo, dentro del borde.
final
type MinInputType
Tipo semántico que configura teclado, acción y comportamiento por defecto.
final
variant MinInputVariant
Variante visual. Use MinInputVariant.error para forzar el estado de error sin necesidad de un errorText.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<MinInput>
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