password static method

Widget password({
  1. FTextFieldStyle style(
    1. FTextFieldStyle style
    )?,
  2. FFieldBuilder<FTextFieldStyle> builder = Defaults.builder,
  3. Widget? label = const LocalizedText.password(),
  4. String? hint,
  5. Widget? description,
  6. Widget? error,
  7. TextMagnifierConfiguration? magnifierConfiguration,
  8. Object groupId = EditableText,
  9. TextEditingController? controller,
  10. FocusNode? focusNode,
  11. TextInputType? keyboardType,
  12. TextInputAction textInputAction = TextInputAction.next,
  13. TextCapitalization textCapitalization = TextCapitalization.none,
  14. TextAlign textAlign = TextAlign.start,
  15. TextAlignVertical? textAlignVertical,
  16. TextDirection? textDirection,
  17. bool autofocus = false,
  18. WidgetStatesController? statesController,
  19. String obscuringCharacter = '•',
  20. bool autocorrect = false,
  21. SmartDashesType? smartDashesType,
  22. SmartQuotesType? smartQuotesType,
  23. bool enableSuggestions = false,
  24. int? minLines,
  25. int maxLines = 1,
  26. bool expands = false,
  27. bool readOnly = false,
  28. bool? showCursor,
  29. int? maxLength,
  30. MaxLengthEnforcement? maxLengthEnforcement,
  31. ValueChanged<String>? onChange,
  32. GestureTapCallback? onTap,
  33. TapRegionCallback? onTapOutside,
  34. bool onTapAlwaysCalled = false,
  35. VoidCallback? onEditingComplete,
  36. ValueChanged<String>? onSubmit,
  37. AppPrivateCommandCallback? onAppPrivateCommand,
  38. List<TextInputFormatter>? inputFormatters,
  39. bool enabled = true,
  40. bool? ignorePointers,
  41. bool enableInteractiveSelection = true,
  42. bool? selectAllOnFocus,
  43. TextSelectionControls? selectionControls,
  44. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  45. MouseCursor? mouseCursor,
  46. FTextFieldCounterBuilder? counterBuilder,
  47. ScrollPhysics? scrollPhysics,
  48. ScrollController? scrollController,
  49. Iterable<String> autofillHints = const [AutofillHints.password],
  50. String? restorationId,
  51. bool stylusHandwritingEnabled = true,
  52. bool enableIMEPersonalizedLearning = true,
  53. ContentInsertionConfiguration? contentInsertionConfiguration,
  54. EditableTextContextMenuBuilder contextMenuBuilder = Defaults.contextMenuBuilder,
  55. bool canRequestFocus = true,
  56. UndoHistoryController? undoController,
  57. SpellCheckConfiguration? spellCheckConfiguration,
  58. FPasswordFieldIconBuilder<FTextFieldStyle>? prefixBuilder,
  59. FPasswordFieldIconBuilder<FTextFieldStyle>? suffixBuilder = PasswordField.defaultToggleBuilder,
  60. bool clearable(
    1. TextEditingValue
    ) = Defaults.clearable,
  61. String? initialText,
  62. ValueNotifier<bool>? obscureTextController,
  63. 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,
);