PasswordInput
A TextInput tuned for password / secret entry: every typed grapheme
is rendered as a single • (or obscuringCharacter) regardless of
what’s in the controller. The real text is unchanged; only the
displayed glyphs are masked.
Learn more: Forms & validation
Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.
PasswordInput( controller: controller, semanticLabel: 'Password', // Ctrl+R shows or hides the value while the field has focus.)Details
Section titled “Details”When canReveal is set (the default), revealChord (Ctrl+R) toggles a
show / hide state while the field is focused, so a user can sanity-check
what they typed. The field consumes the chord, so it never reaches
app-level shortcuts. The clipboard and the semantic value stay redacted
even while revealed — revealing is a visual convenience only.
This is sugar over TextInput(obscureText: true) so the call site reads
as “this is a password,” not “a text field that happens to be obscured.”
Constructors
Section titled “Constructors”PasswordInput()
Section titled “PasswordInput()”| Parameter | Type | Default | Description |
|---|---|---|---|
controller: | TextEditingController? | — | Text controller holding the unredacted secret value. |
focusNode: | FocusNode? | — | Focus node used by the underlying text input. |
autofocus: | bool | false | Whether the field should request focus when mounted. |
onChanged: | void Function(String text)? | — | Called with the new unredacted text on every edit. See TextInput.onChanged. |
onSubmit: | void Function(String text)? | — | Called with the unredacted text when the user submits. |
onEscape: | void Function()? | — | Called when Escape is pressed. |
placeholder: | String | '' | Placeholder text shown when the field is empty. |
placeholderStyle: | CellStyle | const CellStyle(dim: true) | Style used for placeholder. |
style: | CellStyle | CellStyle.none | Entered-text base styling, plus optional hover, focus, disabled, and invalid state entries from CellStyle.interactive. |
cursorStyle: | CellStyle | const CellStyle(inverse: true) | Style applied to the cursor cell. |
obscuringCharacter: | String | '•' | Glyph used in place of each typed grapheme. Defaults to •. |
enabled: | bool | true | Whether the field accepts focus and user input. |
readOnly: | bool | false | Whether the field can receive focus but not edit text. |
canReveal: | bool | true | When true, revealChord toggles the masked / plain rendering while the field is focused. |
revealChord: | KeySequence? | — | The sequence that toggles reveal. Defaults to Ctrl+R. The focused field consumes it, so it shadows any app-level binding on the same sequence. |
validationError: | String? | — | Marks the current value invalid: the field draws in the theme’s error style and reports this message through semantics, but doesn’t show the text. Inside a FormField, this message wins over the FormField’s validator, though not over its own error, and the FormField shows the winning message below the input. |
semanticLabel: | String? | — | Label exposed through the semantic app graph. |
semanticState: | SemanticState | SemanticState.empty | Additional semantic metadata for app-specific secret fields. More |
semanticState: Secret-field facts owned byPasswordInput, such asfieldTypeand redaction state, remain authoritative.
Source
Section titled “Source”PasswordInput is defined in packages/fleury/lib/src/catalog/password_input.dart.
Category: Inputs & controls · All widgets