CustomPasswordField class
A specialized text field for password input with visibility toggle
This widget provides a secure text input field with the ability to toggle password visibility via an icon button.
Example:
CustomPasswordField(
label: 'Password',
controller: _passwordController,
)
In a login form:
Column(
children: [
CustomTextField(
label: 'Email',
controller: _emailController,
),
const SizedBox(height: 16),
CustomPasswordField(
label: 'Password',
controller: _passwordController,
),
const SizedBox(height: 24),
ElevatedButton(
onPressed: _login,
child: const Text('Login'),
),
],
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CustomPasswordField
Constructors
- CustomPasswordField({Key? key, required String label, TextEditingController? controller})
-
Creates a CustomPasswordField with the required
labeland optionalcontrollerconst
Properties
- controller → TextEditingController?
-
Optional controller to manage the text 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
- label → String
-
The label text displayed for this password field
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< CustomPasswordField> -
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