feat: auth done
This commit is contained in:
@@ -19,10 +19,31 @@ abstract class Validators {
|
||||
return null;
|
||||
}
|
||||
|
||||
static String? validateRepeatPassword(
|
||||
String repeatPassword,
|
||||
String password,
|
||||
) {
|
||||
if (repeatPassword.isEmpty) {
|
||||
return navigatorKey.currentContext?.loc.field_cannot_be_empty;
|
||||
} else if (repeatPassword != password) {
|
||||
return navigatorKey.currentContext?.loc.passwords_do_not_match;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static String? validateFields(String value) {
|
||||
if (value.isEmpty) {
|
||||
return navigatorKey.currentContext?.loc.field_cannot_be_empty;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static String? validateOtpFields(String value) {
|
||||
if (value.isEmpty) {
|
||||
return navigatorKey.currentContext?.loc.field_cannot_be_empty;
|
||||
} else if (value.length < 5) {
|
||||
return navigatorKey.currentContext?.loc.otp_code_incomplete;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user