isValidateFields method

bool isValidateFields()

Implementation

bool isValidateFields() {
  // Check if the username is empty
  if (userNameController!.text.isEmpty) {
    AppUtils.showSnackBar('Username cannot be empty',
        background: AppColors.error);
    return false;
  }

  // Check if the password is empty
  if (passwordController!.text.isEmpty) {
    AppUtils.showSnackBar('Password cannot be empty',
        background: AppColors.error);
    return false;
  }

  // Add more validation rules if needed
  // For example, check password length
  // if (passwordController!.text.length < 6) {
  //   AppUtils.showSnackBar('Password must be at least 6 characters long',
  //       background: AppColors.error);
  //   return false;
  // }

  // Return null if everything is valid
  return true;
}