RegexUI class
Live checklist for a text field: shows which rules (password, user name, e-mail, …) the current input meets.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- RegexUI
Constructors
-
RegexUI({Key? key, required TextEditingController controller, required List<
RegexModel> regexList, FocusNode? focusNode, EdgeInsets? padding, EdgeInsets? margin, BoxDecoration? boxDecoration, IconData? iconTrue, IconData? iconFalse, Color? textColorTrue, Color? textColorFalse, Color? iconColorTrue, Color? iconColorFalse, TextStyle? textStyle, dynamic validate(bool isValid)?, RegexUIVisibility? visibility, RegexUIStyle style = RegexUIStyle.list, bool showStrength = false, RegexUIStrength strengthMode = RegexUIStrength.rules, List<String> ? strengthLabels, bool optional = false, String? metLabel, String? unmetLabel}) -
Creates the checklist for
controller.const
Properties
- boxDecoration → BoxDecoration?
-
Decoration of the rule box.
final
- controller → TextEditingController
-
The field's controller; the rules are checked against its text.
final
- focusNode → FocusNode?
-
The field's focus node. Needed for RegexUIVisibility.focus.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- iconColorFalse → Color?
-
Default badge colors when a rule is met / not met.
final
- iconColorTrue → Color?
-
Default badge colors when a rule is met / not met.
final
- iconFalse → IconData?
-
Default icon when a rule is met / not met.
final
- iconTrue → IconData?
-
Default icon when a rule is met / not met.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- margin → EdgeInsets?
-
Padding and margin of the rule box.
final
- metLabel → String?
-
Screen reader words for a met / not met rule. Default: RegexLabels.
final
- optional → bool
-
May be left empty: empty counts as valid for validate and RegexForm.
final
- padding → EdgeInsets?
-
Padding and margin of the rule box.
final
-
regexList
→ List<
RegexModel> -
The rules to show, in order.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showStrength → bool
-
Shows a strength bar above the rules.
final
-
strengthLabels
→ List<
String> ? -
Words shown next to the bar, weakest first, e.g. Weak / Fair / Strong.
Defaults to five English labels in RegexUIStrength.password mode and
none in RegexUIStrength.rules mode.
final
- strengthMode → RegexUIStrength
-
What the bar measures: met rules or real password strength.
final
- style → RegexUIStyle
-
List or chips.
final
- textColorFalse → Color?
-
Default text colors when a rule is met / not met.
final
- textColorTrue → Color?
-
Default text colors when a rule is met / not met.
final
- textStyle → TextStyle?
-
Default text style of the rule titles.
final
- unmetLabel → String?
-
Screen reader words for a met / not met rule. Default: RegexLabels.
final
- validate → dynamic Function(bool isValid)?
-
Called on every change with whether all rules are met.
final
- visibility → RegexUIVisibility?
-
When the rules are shown. Defaults to RegexUIVisibility.focus when a
focusNode is given, otherwise RegexUIVisibility.always.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< RegexUI> -
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