PasswordChecklist class
Widget de checklist para validação de senha em tempo real.
Exibe regras configuráveis e indica visualmente quais foram atendidas. Suporta customização de cores, mensagens, ícones e layout.
Example:
PasswordChecklist(
controller: myController,
minCharacters: 8,
onValidationChanged: (valid) => setState(() => _isValid = valid),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PasswordChecklist
Constructors
-
PasswordChecklist({Key? key, required TextEditingController controller, required ValueChanged<
bool> onValidationChanged, bool checkEightCharacters = true, bool checkSpecialCharacter = true, bool checkNumber = true, bool checkUppercase = true, bool checkLowercase = true, bool checkOnlyNumbers = false, int minCharacters = 8, RegExp? specialCharactersRegex, Color? validColor, Color? invalidColor, String? eightCharactersMessage, String? specialCharacterMessage, String? numberMessage, String? uppercaseMessage, String? lowercaseMessage, String? onlyNumbersMessage, Widget? customIcon, Widget? customIconBuilder(String ruleId, bool isValid)?, double itemSpacing = 8.0, TextStyle? validTextStyle, TextStyle? invalidTextStyle, Widget? itemBuilder(PasswordRuleItem item)?, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.start, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, List<PasswordRuleType> ? ruleOrder}) -
const
Properties
- checkEightCharacters → bool
-
Verifica comprimento mínimo. Default: true.
final
- checkLowercase → bool
-
Verifica letra minúscula. Default: true.
final
- checkNumber → bool
-
Verifica presença de número. Default: true.
final
- checkOnlyNumbers → bool
-
Rejeita senhas compostas apenas por números. Default: false.
Since 2.0.0
final
- checkSpecialCharacter → bool
-
Verifica caractere especial. Default: true.
final
- checkUppercase → bool
-
Verifica letra maiúscula. Default: true.
final
- controller → TextEditingController
-
Controller do campo de senha.
final
- crossAxisAlignment → CrossAxisAlignment
-
Alinhamento transversal da coluna. Since 2.0.0
final
- customIcon → Widget?
-
Ícone único para todos os itens. Se customIconBuilder existir,
este é ignorado.
final
- customIconBuilder → Widget? Function(String ruleId, bool isValid)?
-
Ícone customizado por regra. Since 2.0.0
final
- eightCharactersMessage → String?
-
Mensagem para comprimento mínimo.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- invalidColor → Color?
-
Cor quando a regra não está satisfeita. Default: Colors.red.
final
- invalidTextStyle → TextStyle?
-
Estilo do texto quando inválido. Since 2.0.0
final
- itemBuilder → Widget? Function(PasswordRuleItem item)?
-
Builder customizado para cada item. Se retornar não-nulo,
substitui o layout padrão. Since 2.0.0
final
- itemSpacing → double
-
Espaço entre itens. Default: 8.0. Since 2.0.0
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- lowercaseMessage → String?
-
Mensagem para minúscula.
final
- mainAxisAlignment → MainAxisAlignment
-
Alinhamento principal da coluna. Since 2.0.0
final
- margin → EdgeInsetsGeometry?
-
Margem externa do container. Since 2.0.0
final
- minCharacters → int
-
Comprimento mínimo quando checkEightCharacters é true. Default: 8.
final
- numberMessage → String?
-
Mensagem para número.
final
- onlyNumbersMessage → String?
-
Mensagem quando a senha é apenas números. Since 2.0.0
final
-
onValidationChanged
→ ValueChanged<
bool> -
Callback chamado quando o status de validação muda.
final
- padding → EdgeInsetsGeometry?
-
Padding interno do container. Since 2.0.0
final
-
ruleOrder
→ List<
PasswordRuleType> ? -
Ordem das regras exibidas. Se null, usa a ordem padrão. Since 2.0.0
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- specialCharacterMessage → String?
-
Mensagem para caractere especial.
final
- specialCharactersRegex → RegExp?
-
Regex para caracteres especiais. Default:
!@#\$%^&*(),.?":{}|<>Since 2.0.0final - uppercaseMessage → String?
-
Mensagem para maiúscula.
final
- validColor → Color?
-
Cor quando a regra está satisfeita. Default: Colors.green.
final
- validTextStyle → TextStyle?
-
Estilo do texto quando válido. Since 2.0.0
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PasswordChecklist> -
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
Static Properties
-
defaultRuleOrder
→ List<
PasswordRuleType> -
Ordem padrão das regras.
no setter