password static method
Widget
password({
- FTextFieldStyle style(
- FTextFieldStyle style
- FFieldBuilder<
FTextFieldStyle> builder = Defaults.builder, - Widget? label = const LocalizedText.password(),
- String? hint,
- Widget? description,
- Widget? error,
- TextMagnifierConfiguration? magnifierConfiguration,
- Object groupId = EditableText,
- TextEditingController? controller,
- FocusNode? focusNode,
- TextInputType? keyboardType,
- TextInputAction textInputAction = TextInputAction.next,
- TextCapitalization textCapitalization = TextCapitalization.none,
- TextAlign textAlign = TextAlign.start,
- TextAlignVertical? textAlignVertical,
- TextDirection? textDirection,
- bool autofocus = false,
- WidgetStatesController? statesController,
- String obscuringCharacter = '•',
- bool autocorrect = false,
- SmartDashesType? smartDashesType,
- SmartQuotesType? smartQuotesType,
- bool enableSuggestions = false,
- int? minLines,
- int maxLines = 1,
- bool expands = false,
- bool readOnly = false,
- bool? showCursor,
- int? maxLength,
- MaxLengthEnforcement? maxLengthEnforcement,
- ValueChanged<
String> ? onChange, - GestureTapCallback? onTap,
- TapRegionCallback? onTapOutside,
- bool onTapAlwaysCalled = false,
- VoidCallback? onEditingComplete,
- ValueChanged<
String> ? onSubmit, - AppPrivateCommandCallback? onAppPrivateCommand,
- List<
TextInputFormatter> ? inputFormatters, - bool enabled = true,
- bool? ignorePointers,
- bool enableInteractiveSelection = true,
- bool? selectAllOnFocus,
- TextSelectionControls? selectionControls,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- MouseCursor? mouseCursor,
- FTextFieldCounterBuilder? counterBuilder,
- ScrollPhysics? scrollPhysics,
- ScrollController? scrollController,
- Iterable<
String> autofillHints = const [AutofillHints.password], - String? restorationId,
- bool stylusHandwritingEnabled = true,
- bool enableIMEPersonalizedLearning = true,
- ContentInsertionConfiguration? contentInsertionConfiguration,
- EditableTextContextMenuBuilder contextMenuBuilder = Defaults.contextMenuBuilder,
- bool canRequestFocus = true,
- UndoHistoryController? undoController,
- SpellCheckConfiguration? spellCheckConfiguration,
- FPasswordFieldIconBuilder<
FTextFieldStyle> ? prefixBuilder, - FPasswordFieldIconBuilder<
FTextFieldStyle> ? suffixBuilder = PasswordField.defaultToggleBuilder, - bool clearable() = Defaults.clearable,
- String? initialText,
- ValueNotifier<
bool> ? obscureTextController, - Key? key,
Creates a FTextField configured for password entry with a visibility toggle.
By default, suffixBuilder
is an eye icon that toggles showing and hiding the password. Replace the toggle by
providing a custom suffixBuilder
, or disable it by setting it to null
.
The obscureTextController
parameter is a ValueNotifier that controls the obscuring state.
autofillHints
defaults to AutofillHints.password. Use AutofillHints.newPassword for new-password inputs.
Implementation
static Widget password({
FTextFieldStyle Function(FTextFieldStyle style)? style,
FFieldBuilder<FTextFieldStyle> builder = Defaults.builder,
Widget? label = const LocalizedText.password(),
String? hint,
Widget? description,
Widget? error,
TextMagnifierConfiguration? magnifierConfiguration,
Object groupId = EditableText,
TextEditingController? controller,
FocusNode? focusNode,
TextInputType? keyboardType,
TextInputAction textInputAction = TextInputAction.next,
TextCapitalization textCapitalization = TextCapitalization.none,
TextAlign textAlign = TextAlign.start,
TextAlignVertical? textAlignVertical,
TextDirection? textDirection,
bool autofocus = false,
WidgetStatesController? statesController,
String obscuringCharacter = '•',
bool autocorrect = false,
SmartDashesType? smartDashesType,
SmartQuotesType? smartQuotesType,
bool enableSuggestions = false,
int? minLines,
int maxLines = 1,
bool expands = false,
bool readOnly = false,
bool? showCursor,
int? maxLength,
MaxLengthEnforcement? maxLengthEnforcement,
ValueChanged<String>? onChange,
GestureTapCallback? onTap,
TapRegionCallback? onTapOutside,
bool onTapAlwaysCalled = false,
VoidCallback? onEditingComplete,
ValueChanged<String>? onSubmit,
AppPrivateCommandCallback? onAppPrivateCommand,
List<TextInputFormatter>? inputFormatters,
bool enabled = true,
bool? ignorePointers,
bool enableInteractiveSelection = true,
bool? selectAllOnFocus,
TextSelectionControls? selectionControls,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
MouseCursor? mouseCursor,
FTextFieldCounterBuilder? counterBuilder,
ScrollPhysics? scrollPhysics,
ScrollController? scrollController,
Iterable<String> autofillHints = const [AutofillHints.password],
String? restorationId,
bool stylusHandwritingEnabled = true,
bool enableIMEPersonalizedLearning = true,
ContentInsertionConfiguration? contentInsertionConfiguration,
EditableTextContextMenuBuilder contextMenuBuilder = Defaults.contextMenuBuilder,
bool canRequestFocus = true,
UndoHistoryController? undoController,
SpellCheckConfiguration? spellCheckConfiguration,
FPasswordFieldIconBuilder<FTextFieldStyle>? prefixBuilder,
FPasswordFieldIconBuilder<FTextFieldStyle>? suffixBuilder = PasswordField.defaultToggleBuilder,
bool Function(TextEditingValue) clearable = Defaults.clearable,
String? initialText,
ValueNotifier<bool>? obscureTextController,
Key? key,
}) => PasswordField(
properties: PasswordFieldProperties(
style: style,
builder: builder,
label: label,
hint: hint,
description: description,
error: error,
magnifierConfiguration: magnifierConfiguration,
groupId: groupId,
controller: controller,
focusNode: focusNode,
keyboardType: keyboardType,
textInputAction: textInputAction,
textCapitalization: textCapitalization,
textAlign: textAlign,
textAlignVertical: textAlignVertical,
textDirection: textDirection,
autofocus: autofocus,
statesController: statesController,
obscuringCharacter: obscuringCharacter,
autocorrect: autocorrect,
smartDashesType: smartDashesType,
smartQuotesType: smartQuotesType,
enableSuggestions: enableSuggestions,
minLines: minLines,
maxLines: maxLines,
expands: expands,
readOnly: readOnly,
showCursor: showCursor,
maxLength: maxLength,
maxLengthEnforcement: maxLengthEnforcement,
onChange: onChange,
onTap: onTap,
onTapOutside: onTapOutside,
onTapAlwaysCalled: onTapAlwaysCalled,
onEditingComplete: onEditingComplete,
onSubmit: onSubmit,
onAppPrivateCommand: onAppPrivateCommand,
inputFormatters: inputFormatters,
enabled: enabled,
ignorePointers: ignorePointers,
enableInteractiveSelection: enableInteractiveSelection,
selectAllOnFocus: selectAllOnFocus,
selectionControls: selectionControls,
dragStartBehavior: dragStartBehavior,
mouseCursor: mouseCursor,
counterBuilder: counterBuilder,
scrollPhysics: scrollPhysics,
scrollController: scrollController,
autofillHints: autofillHints,
restorationId: restorationId,
stylusHandwritingEnabled: stylusHandwritingEnabled,
enableIMEPersonalizedLearning: enableIMEPersonalizedLearning,
contentInsertionConfiguration: contentInsertionConfiguration,
contextMenuBuilder: contextMenuBuilder,
canRequestFocus: canRequestFocus,
undoController: undoController,
spellCheckConfiguration: spellCheckConfiguration,
prefixBuilder: prefixBuilder,
suffixBuilder: suffixBuilder,
clearable: clearable,
initialText: initialText,
obscureTextController: obscureTextController,
),
key: key,
);