RegexTextField class

A text field with its rule checklist, strength bar and a show / hide button in one widget. Works inside a Form: Form.validate() checks the same rules.

Inheritance

Constructors

RegexTextField({Key? key, required List<RegexModel> rules, TextEditingController? controller, FocusNode? focusNode, InputDecoration decoration = const InputDecoration(), bool obscureText = false, TextInputType? keyboardType, TextInputAction? textInputAction, Iterable<String>? autofillHints, ValueChanged<bool>? validate, ValueChanged<String>? onSubmitted, bool optional = false, RegexUIVisibility visibility = RegexUIVisibility.focus, RegexUIStyle style = RegexUIStyle.list, bool showStrength = false, RegexUIStrength strengthMode = RegexUIStrength.rules, List<String>? strengthLabels, String? showLabel, String? hideLabel})
Creates a field checked against rules.
const
RegexTextField.email({Key? key, List<RegexModel>? rules, TextEditingController? controller, FocusNode? focusNode, TextInputAction? textInputAction, ValueChanged<bool>? validate, ValueChanged<String>? onSubmitted, bool optional = false, RegexUIVisibility visibility = RegexUIVisibility.focus, String? showLabel, String? hideLabel, String? label, RegexUIStyle style = RegexUIStyle.chips})
An e-mail field in one line with RegexModel.emailRules.
RegexTextField.password({Key? key, List<RegexModel>? rules, TextEditingController? controller, FocusNode? focusNode, TextInputAction? textInputAction, ValueChanged<bool>? validate, ValueChanged<String>? onSubmitted, bool optional = false, RegexUIVisibility visibility = RegexUIVisibility.focus, String? showLabel, String? hideLabel, String? label, int minLength = 8, RegexUIStyle style = RegexUIStyle.list, List<String>? strengthLabels})
A password field in one line: hidden text with a show / hide button, RegexModel.passwordRules and a real strength bar with labels. Pass rules to replace the default rules.
RegexTextField.userName({Key? key, List<RegexModel>? rules, TextEditingController? controller, FocusNode? focusNode, TextInputAction? textInputAction, ValueChanged<bool>? validate, ValueChanged<String>? onSubmitted, bool optional = false, RegexUIVisibility visibility = RegexUIVisibility.focus, String? showLabel, String? hideLabel, String? label, RegexUIStyle style = RegexUIStyle.chips})
A user name field in one line with RegexModel.userNameRules.

Properties

autofillHints → Iterable<String>?
Autofill hints, e.g. AutofillHints.password.
final
controller → TextEditingController?
Optional; created and disposed by the widget when null.
final
decoration → InputDecoration
Decoration of the field. The show / hide button goes into its suffix.
final
focusNode → FocusNode?
Optional; created and disposed by the widget when null.
final
hashCode → int
The hash code for this object.
no setterinherited
hideLabel → String?
Tooltips (and screen reader labels) of the show / hide button. Default: RegexLabels.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType → TextInputType?
Keyboard type of the field.
final
obscureText → bool
Hides the text and adds a show / hide button (passwords).
final
onSubmitted → ValueChanged<String>?
Called when the user submits the field.
final
optional → bool
May be left empty: empty counts as valid (no "Required" error, and RegexForm can still be valid); once typed, the rules apply.
final
rules → List<RegexModel>
The rules shown under the field and used by the form validator.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showLabel → String?
Tooltips (and screen reader labels) of the show / hide button. Default: RegexLabels.
final
showStrength → bool
Shows a strength bar above the rules.
final
strengthLabels → List<String>?
Words next to the strength bar, weakest first.
final
strengthMode → RegexUIStrength
What the strength bar measures.
final
style → RegexUIStyle
List or chips.
final
textInputAction → TextInputAction?
Action button of the keyboard (next, done).
final
validate → ValueChanged<bool>?
Called on every change with whether all rules are met.
final
visibility → RegexUIVisibility
When the rules are shown. Defaults to while the field has focus.
final

Methods

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