validatePassword static method

String? validatePassword(
  1. String? value
)

Validates a password. Returns null if valid, otherwise an error message.

Implementation

static String? validatePassword(String? value) {
  if (value == null || value.isEmpty) return 'Password is required';
  if (value.length < 6) return 'Password must be at least 6 characters';
  return null;
}