matches method
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;
}