HeraText constructor

HeraText({
  1. required LoginType loginType,
  2. String? passwordHint,
  3. String? identifierHint,
  4. String? missingIdentifierTitle,
  5. String? missingIdentifierDescription,
  6. String? missingPasswordTitle,
  7. String? missingPasswordDescription,
  8. String? errorTitle,
  9. String? errorDescription,
  10. String? noWifiTitle,
  11. String? noWifiDescription,
  12. String? welcomeTitle,
  13. String? welcomeDetails,
  14. String? registerTitle,
  15. String? registerDetails,
  16. String? registerButton,
  17. String? repeatPasswordHint,
  18. String? passwordDoNotMatchTitle,
  19. String? passwordDoNotMatchDescription,
  20. String? passwordContainsEightCharsHint,
  21. String? passwordContainsSpecialHint,
  22. String? passwordContainsNumberHint,
  23. String? passwordsMustMatchHint,
  24. String? loginTitle,
  25. String? loginDetails,
  26. String? loginButton,
  27. String? forgotPasswordDetails,
  28. String? verificationCodeTitle,
  29. String? alreadyHaveAccountDescription,
  30. String? registerDisabledTipNoteMessage,
  31. String? verifyIdentifierTitle,
  32. String? verifyIdentifierDescription,
  33. String? verifyButton,
  34. String? invalidCodeTitle,
  35. String? invalidCodeDescription,
  36. String? identifierName,
  37. String? passwordName,
  38. String? repeatPasswordName,
})

Implementation

HeraText({
  required LoginType loginType,
  String? passwordHint,
  String? identifierHint,
  String? missingIdentifierTitle,
  String? missingIdentifierDescription,
  String? missingPasswordTitle,
  String? missingPasswordDescription,
  String? errorTitle,
  String? errorDescription,
  String? noWifiTitle,
  String? noWifiDescription,
  String? welcomeTitle,
  String? welcomeDetails,
  String? registerTitle,
  String? registerDetails,
  String? registerButton,
  String? repeatPasswordHint,
  String? passwordDoNotMatchTitle,
  String? passwordDoNotMatchDescription,
  String? passwordContainsEightCharsHint,
  String? passwordContainsSpecialHint,
  String? passwordContainsNumberHint,
  String? passwordsMustMatchHint,
  String? loginTitle,
  String? loginDetails,
  String? loginButton,
  String? forgotPasswordDetails,
  String? verificationCodeTitle,
  String? alreadyHaveAccountDescription,
  String? registerDisabledTipNoteMessage,
  String? verifyIdentifierTitle,
  String? verifyIdentifierDescription,
  String? verifyButton,
  String? invalidCodeTitle,
  String? invalidCodeDescription,
  String? identifierName,
  String? passwordName,
  String? repeatPasswordName,
}) {
  this.passwordHint = passwordHint ?? "JohnDoe1234!";
  this.identifierHint = identifierHint ??
      ((loginType == LoginType.EMAIL_VERIFICATION_CODE ||
          loginType == LoginType.EMAIL_PASSWORD) ? "your@email.io" : (loginType == LoginType.PHONE_PASSWORD ||loginType == LoginType.PHONE_VERIFICATION_CODE) ? "(212)456-7890" : "the-amazing-spiderman");
  this.missingIdentifierTitle =
      missingIdentifierTitle ?? ((loginType == LoginType.EMAIL_VERIFICATION_CODE ||
          loginType == LoginType.EMAIL_PASSWORD) ? "Missing required email" : (loginType == LoginType.PHONE_PASSWORD ||loginType == LoginType.PHONE_VERIFICATION_CODE) ? "Missing required phone number" : "Missing required username");
  this.missingIdentifierDescription = missingIdentifierDescription ??
      ((loginType == LoginType.EMAIL_VERIFICATION_CODE ||
          loginType == LoginType.EMAIL_PASSWORD) ? "Please enter your email to login/register your account" : (loginType == LoginType.PHONE_PASSWORD ||loginType == LoginType.PHONE_VERIFICATION_CODE) ? "Please enter your phone number to login/register your account" : "Please enter your username to login/register your account");
  this.missingPasswordTitle =
      missingPasswordTitle ?? "Missing required password";
  this.missingPasswordDescription = missingPasswordDescription ??
      "Please enter your password to login/register your account";
  this.errorTitle = errorTitle ?? "Something went wrong";
  this.errorDescription =
      errorDescription ?? "We encountered an error. Please try again.";
  this.noWifiTitle = noWifiTitle ?? "No wifi connection";
  this.noWifiDescription = noWifiDescription ??
      "We cannot authenticate your credentials without a valid wifi or data connection";
  this.welcomeTitle = welcomeTitle ?? "Welcome";
  this.welcomeDetails =
      welcomeDetails ?? "Register for an account or sign in below";
  this.registerTitle = registerTitle ?? "Register";
  this.registerDetails = registerDetails ??
      "Fill in the details below to register for an account";
  this.registerButton = registerButton ?? "Register";
  this.repeatPasswordHint = repeatPasswordHint ?? "Repeat your password";
  this.passwordDoNotMatchTitle =
      passwordDoNotMatchTitle ?? "Passwords do not match";
  this.passwordDoNotMatchDescription = passwordDoNotMatchDescription ??
      "The entered password and repeat password do not match";
  this.passwordContainsEightCharsHint =
      passwordContainsEightCharsHint ?? "Password must contain 8 chars";
  this.passwordContainsSpecialHint =
      passwordContainsSpecialHint ?? "Password must contain special char";
  this.passwordContainsNumberHint =
      passwordContainsNumberHint ?? "Password must contain number";
  this.passwordsMustMatchHint =
      passwordsMustMatchHint ?? "The two passwords must match";
  this.loginTitle = loginTitle ?? "Login";
  this.loginDetails =
      loginDetails ?? "Fill in the details below to login to your account";
  this.loginButton = loginButton ?? "Login";
  this.forgotPasswordDetails = forgotPasswordDetails ?? "Forgot password?";
  this.verificationCodeTitle =
      verificationCodeTitle ?? "Enter provided verification code";
  this.alreadyHaveAccountDescription =
      alreadyHaveAccountDescription ?? "Already have an account?";
  this.registerDisabledTipNoteMessage = registerDisabledTipNoteMessage ??
      "Enter a valid password to create account";
  this.verifyIdentifierTitle = verifyIdentifierTitle ?? "Verify your account";
  this.verifyIdentifierDescription = verifyIdentifierDescription ??
      "We have sent you a verification code. Please enter the code below.";
  this.verifyButton = verifyButton ?? "Verify account";
  this.invalidCodeTitle = invalidCodeTitle ?? "Invalid code";
  this.invalidCodeDescription =
      invalidCodeDescription ?? "The code that you have provided is invalid";
  this.identifierName = identifierName ?? ((loginType == LoginType.EMAIL_VERIFICATION_CODE ||
      loginType == LoginType.EMAIL_PASSWORD) ? "Email" : (loginType == LoginType.PHONE_PASSWORD ||loginType == LoginType.PHONE_VERIFICATION_CODE) ? "Phone" : "Username");
  this.passwordName = passwordName ?? "Password";
  this.repeatPasswordName = repeatPasswordName ?? "Repeat password";
}