matches method

String? matches(
  1. String? confirmPassword
)

matches checks if the two passwords match. Provides a basic error message. 'Passwords do not match.'

Implementation

String? matches(String? confirmPassword) {
  if (!(this == confirmPassword)) {
    return 'Passwords do not match.';
  }
  return null;
}