feat:register page ui done

This commit is contained in:
jahongireshonqulov
2025-10-29 15:16:44 +05:00
parent 2ed2c430c0
commit ece15635eb
18 changed files with 708 additions and 241 deletions

View File

@@ -0,0 +1,28 @@
import 'package:food_delivery_client/core/core.dart';
abstract class Validators {
static String? validatePhoneNumber(String phoneNumber) {
if (phoneNumber.isEmpty) {
return navigatorKey.currentContext?.loc.field_cannot_be_empty;
} else if (phoneNumber.length < 12) {
return navigatorKey.currentContext?.loc.invalid_phone_format;
}
return null;
}
static String? validatePassword(String password) {
if (password.isEmpty) {
return navigatorKey.currentContext?.loc.field_cannot_be_empty;
} else if (password.length < 6) {
return navigatorKey.currentContext?.loc.password_too_short;
}
return null;
}
static String? validateFields(String value) {
if (value.isEmpty) {
return navigatorKey.currentContext?.loc.field_cannot_be_empty;
}
return null;
}
}