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