Validators class

Input validation utilities for Better Auth.

This class provides static methods for validating common input fields used in authentication forms.

Usage

final emailError = Validators.validateEmail(emailController.text);
final passwordError = Validators.validatePassword(passwordController.text);

if (emailError == null && passwordError == null) {
  // Form is valid, proceed with submission
}

Constructors

Validators()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

validateEmail(String? email) String?
Validates an email address.
validateName(String? name, {int minLength = 2, int maxLength = 50}) String?
Validates a name.
validatePassword(String? password, {int minLength = 8}) String?
Validates a password.
validatePasswordConfirmation(String? password, String? confirmation) String?
Validates that a confirmation password matches the original.