FeedbackStrings.auto constructor

FeedbackStrings.auto()

Create FeedbackStrings with automatic language detection Detects the device language and returns appropriate translations

Implementation

factory FeedbackStrings.auto() {
  final translations = LocalizationService.getTranslations();
  return FeedbackStrings(
    pageTitle: translations['pageTitle']!,
    feedbackInputLabel: translations['feedbackInputLabel']!,
    feedbackInputHint: translations['feedbackInputHint']!,
    feedbackInputValidationError:
        translations['feedbackInputValidationError']!,
    submitButtonLabel: translations['submitButtonLabel']!,
    sentSuccessfully: translations['sentSuccessfully']!,
    sendError: translations['sendError']!,
    nameLabel: translations['nameLabel'] ?? 'Name (Optional)',
    nameHint: translations['nameHint'] ?? 'Enter your name',
    emailLabel: translations['emailLabel'] ?? 'Email (Optional)',
    emailHint: translations['emailHint'] ?? 'Enter your email',
    attachmentLabel:
        translations['attachmentLabel'] ?? 'Attach a file (Optional)',
    attachFileLabel: translations['attachFileLabel'] ?? 'Attach File',
    removeAttachment: translations['removeAttachment'] ?? 'Remove Attachment',
    emailValidationError:
        translations['emailValidationError'] ?? 'Please enter a valid email.',
  );
}