CsInput class

Cloudscape's Input: a single-line text field.

It is controlled: pass value and update it in onChange.

CsInput(
  value: name,
  placeholder: 'my-bucket',
  onChange: (v) => setState(() => name = v),
)
CsInput(
  type: CsInputType.search,
  value: query,
  placeholder: 'Find instances',
  onChange: (v) => setState(() => query = v),
)

Put it in a CsFormField for a label, description and error text. The field is 32px tall (28px compact); invalid and warning color the border and thicken its start edge. A search input shows a search icon and, once it has text, a clear button.

Inheritance

Constructors

CsInput({Key? key, required String value, ValueChanged<String>? onChange, ValueChanged<String>? onSubmit, VoidCallback? onFocus, VoidCallback? onBlur, CsInputType type = CsInputType.text, String? placeholder, bool disabled = false, bool readOnly = false, bool invalid = false, bool warning = false, bool autoFocus = false, bool autoComplete = true, bool spellcheck = true, TextInputType? keyboardType, TextInputAction? textInputAction, List<TextInputFormatter>? inputFormatters, Iterable<String>? autofillHints, String? ariaLabel, String? clearAriaLabel, FocusNode? focusNode, Widget? leading, Widget? trailing, Widget? prefix, Widget? suffix, String? inlineLabelText, bool ariaRequired = false, FocusOnKeyEventCallback? onKeyEvent, bool mono = false})
const

Properties

ariaLabel → String?
Accessible name when there is no visible label (Cloudscape ariaLabel).
final
ariaRequired → bool
Announces the field as required.
final
autoComplete → bool
Platform autofill and suggestions (Cloudscape autoComplete).
final
autofillHints → Iterable<String>?
final
autoFocus → bool
final
clearAriaLabel → String?
Accessible name of the clear button of a search input.
final
disabled → bool
final
focusNode → FocusNode?
final
hashCode → int
The hash code for this object.
no setterinherited
inlineLabelText → String?
A small label drawn on the field's top border, to save vertical space when there is no surrounding CsFormField label.
final
inputFormatters → List<TextInputFormatter>?
final
invalid → bool
Red border with a thick start edge. Set it together with the form field's errorText.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType → TextInputType?
Overrides the keyboard chosen from type (Cloudscape inputMode).
final
leading → Widget?
Replaces the start icon (search inputs show a search icon).
final
mono → bool
Monospace text, for IDs and ARNs.
final
onBlur → VoidCallback?
final
onChange → ValueChanged<String>?
Called with the new text on every edit (Cloudscape onChange).
final
onFocus → VoidCallback?
final
onKeyEvent → FocusOnKeyEventCallback?
Key events while the field has focus, before the text field handles them (Cloudscape onKeyDown). Return KeyEventResult.handled to stop the key.
final
onSubmit → ValueChanged<String>?
Called when the user presses Enter or the keyboard's action key.
final
placeholder → String?
final
prefix → Widget?
Fixed content before the editable value (a protocol https://, a currency), separated from it by a divider. Ignored for search inputs.
final
readOnly → bool
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
spellcheck → bool
Spell checking and autocorrect.
final
suffix → Widget?
Fixed content after the editable value (a unit GiB, a domain), separated from it by a divider. Ignored for search inputs.
final
textInputAction → TextInputAction?
final
trailing → Widget?
Content after the text, inside the field.
final
type → CsInputType
final
value → String
The text in the field.
final
warning → bool
Yellow border with a thick start edge. Ignored when invalid.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<CsInput>
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