passwordConfirmationValidator function
Validates the confirmation of a password.
Returns an error message if the value is empty or doesn't match value2.
Otherwise, returns null.
Implementation
String? passwordConfirmationValidator(String? value, String? value2) {
if (value == null || value.isEmpty) {
return getCurrentLocalization() == 'id'
? 'Kolom tidak boleh kosong'
: "Field can't be empty";
} else if (value != value2) {
return getCurrentLocalization() == 'id'
? 'Kata sandi tidak sesuai'
: 'Password does not match';
}
return null;
}