feat: auth done

This commit is contained in:
jahongireshonqulov
2025-10-30 14:41:55 +05:00
parent f47e78a9a2
commit ab1ac6e6fa
26 changed files with 1702 additions and 195 deletions

View File

@@ -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;
}
}