password static method

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

autofillHints defaults to AutofillHints.password. Use AutofillHints.newPassword for new-password inputs.

Implementation

static Widget password({
  FTextFieldControl control = const .managed(),
  FObscureTextControl obscureTextControl = const .managed(),
  FTextFieldSizeVariant size = .md,
  FTextFieldStyleDelta style = const .context(),
  FFieldBuilder<FTextFieldStyle> builder = defaultBuilder,
  Widget? label = const LocalizedText.password(),
  String? hint,
  Widget? description,
  Widget? error,
  TextMagnifierConfiguration? magnifierConfiguration,
  Object groupId = EditableText,
  FocusNode? focusNode,
  TextInputType? keyboardType,
  TextInputAction textInputAction = .next,
  TextCapitalization textCapitalization = .none,
  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,
  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 = .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 = defaultContextMenuBuilder,
  bool canRequestFocus = true,
  UndoHistoryController? undoController,
  SpellCheckConfiguration? spellCheckConfiguration,
  FPasswordFieldIconBuilder<FTextFieldStyle>? prefixBuilder,
  FPasswordFieldIconBuilder<FTextFieldStyle>? suffixBuilder = defaultObscureIconBuilder,
  bool Function(TextEditingValue) clearable = defaultClearable,
  FFieldClearIconBuilder clearIconBuilder = defaultClearIconBuilder,
  Key? key,
}) => TextFieldControl(
  key: key,
  control: control,
  builder: (context, controller, _) => PasswordField(
    controller: controller,
    properties: PasswordFieldProperties(
      size: size,
      style: style,
      builder: builder,
      label: label,
      hint: hint,
      description: description,
      error: error,
      magnifierConfiguration: magnifierConfiguration,
      groupId: groupId,
      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,
      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,
      clearIconBuilder: clearIconBuilder,
      obscureTextControl: obscureTextControl,
    ),
  ),
);