linklytics_feedback 0.0.3
linklytics_feedback: ^0.0.3 copied to clipboard
A Flutter package for collecting user feedback with customizable UI, automatic language detection, and support for 30+ languages.
Linklytics Feedback #
A Flutter package for collecting user feedback with customizable UI and easy integration. This package provides a simple and elegant way to gather user feedback in your Flutter applications.
Features #
- 🎨 Customizable UI: Customize the feedback form appearance and text
- 🚀 Easy Integration: Simple API with minimal setup required
- 📱 Flutter Native: Built specifically for Flutter applications
- 🔧 Flexible Navigation: Support for custom navigation patterns
- 🌐 API Integration: Built-in API service for sending feedback data
- 📦 Lightweight: Minimal dependencies and small package size
- 🌍 Multi-Language Support: Automatic language detection with 30+ languages
- 🔄 Auto-Localization: Detects device language and displays UI accordingly
Getting started #
Add this to your package's pubspec.yaml file:
dependencies:
linklytics_feedback: ^0.0.1
Then run:
flutter pub get
Usage #
Basic Usage (with Automatic Language Detection) #
import 'package:linklytics_feedback/linklytics_feedback.dart';
// Initialize the feedback service
final feedback = LinklyticsFeedback();
// Open feedback form - automatically detects language
await feedback.openFeedback(
apiKey: 'your-api-key-here',
);
The feedback form will automatically detect the language and display the UI in the appropriate language from 30+ supported languages.
Language Detection Priority:
- GetX locale (if you've set
Get.updateLocale()in your app) - Device/Platform locale (system language)
- English (fallback)
Custom Navigation #
await feedback.openFeedback(
apiKey: 'your-api-key-here',
customNavigation: (widget) => Navigator.push(
context,
MaterialPageRoute(builder: (context) => widget),
),
);
Specific Language #
Force a specific language regardless of device settings:
import 'package:linklytics_feedback/linklytics_feedback.dart';
// Spanish
await feedback.openFeedback(
apiKey: 'your-api-key-here',
feedbackStrings: FeedbackStrings.forLanguage('es'),
);
// Arabic
await feedback.openFeedback(
apiKey: 'your-api-key-here',
feedbackStrings: FeedbackStrings.forLanguage('ar'),
);
// Japanese
await feedback.openFeedback(
apiKey: 'your-api-key-here',
feedbackStrings: FeedbackStrings.forLanguage('ja'),
);
Disable Auto-Detection #
await feedback.openFeedback(
apiKey: 'your-api-key-here',
enableAutoLanguageDetection: false, // Disables auto-detection, uses English
);
Custom Strings #
You can also provide completely custom strings:
import 'package:linklytics_feedback/linklytics_feedback.dart';
await feedback.openFeedback(
apiKey: 'your-api-key-here',
feedbackStrings: const FeedbackStrings(
pageTitle: 'Send Feedback',
feedbackInputLabel: 'Your feedback',
feedbackInputHint: 'Tell us what you think...',
feedbackInputValidationError: 'Please enter your feedback.',
submitButtonLabel: 'Submit',
sentSuccessfully: 'Thank you for your feedback!',
sendError: 'Something went wrong. Please try again later.',
),
);
Supported Languages #
The package supports 30+ languages with automatic detection:
| Language Code | Language Name | Native Name |
|---|---|---|
en |
English | English |
ar |
Arabic | العربية |
es |
Spanish | Español |
fr |
French | Français |
de |
German | Deutsch |
zh |
Chinese (Simplified) | 中文 |
ja |
Japanese | 日本語 |
ko |
Korean | 한국어 |
pt |
Portuguese | Português |
ru |
Russian | Русский |
it |
Italian | Italiano |
nl |
Dutch | Nederlands |
tr |
Turkish | Türkçe |
pl |
Polish | Polski |
sv |
Swedish | Svenska |
da |
Danish | Dansk |
no |
Norwegian | Norsk |
fi |
Finnish | Suomi |
el |
Greek | Ελληνικά |
cs |
Czech | Čeština |
hu |
Hungarian | Magyar |
ro |
Romanian | Română |
uk |
Ukrainian | Українська |
th |
Thai | ไทย |
vi |
Vietnamese | Tiếng Việt |
id |
Indonesian | Bahasa Indonesia |
he |
Hebrew | עברית |
hi |
Hindi | हिन्दी |
bn |
Bengali | বাংলা |
ms |
Malay | Bahasa Melayu |
ur |
Urdu | اردو |
Using LocalizationService #
You can also use the LocalizationService directly for advanced use cases:
import 'package:linklytics_feedback/linklytics_feedback.dart';
// Detect current device language
String currentLanguage = LocalizationService.detectLanguage();
print('Current language: $currentLanguage');
// Get all supported languages
List<String> languages = LocalizationService.supportedLanguages;
print('Supported: $languages');
// Get language name
String languageName = LocalizationService.getLanguageName('es');
print('Language name: $languageName'); // Español
// Check if language uses RTL
bool isRTL = LocalizationService.isRTL('ar');
print('Is RTL: $isRTL'); // true
API Reference #
LinklyticsFeedback #
The main class for handling feedback functionality.
Methods
openFeedback({required String apiKey, NavigateCallback? customNavigation, FeedbackStrings? feedbackStrings, bool enableAutoLanguageDetection = true})- Opens the feedback form
apiKey: Your API key for the feedback servicecustomNavigation: Optional custom navigation callbackfeedbackStrings: Optional custom strings for the UI (auto-detects language if not provided)enableAutoLanguageDetection: Enable automatic language detection (default: true)
FeedbackStrings #
Customizable strings for the feedback form UI.
Constructors
FeedbackStrings()- Default constructor with English stringsFeedbackStrings.auto()- Automatically detects device language and returns appropriate translationsFeedbackStrings.forLanguage(String languageCode)- Returns translations for a specific language code
Properties
pageTitle- The title displayed in the app barfeedbackInputLabel- Label for the feedback input fieldfeedbackInputHint- Hint text shown in the feedback input fieldfeedbackInputValidationError- Error message when feedback is emptysubmitButtonLabel- Text shown on the submit buttonsentSuccessfully- Success message after feedback is sentsendError- Error message when feedback submission fails
LocalizationService #
Service for handling language detection and localization.
Methods
detectLanguage()- Detects the current device languagegetTranslations([String? languageCode])- Get translations for a specific languagegetLanguageName(String languageCode)- Get the native name of a languageisRTL(String languageCode)- Check if a language uses right-to-left text directionsupportedLanguages- Get list of all supported language codes
Additional information #
For more information about this package, visit the GitHub repository.
Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
Issues #
If you encounter any issues or have feature requests, please file them on the GitHub issues page.
License #
This project is licensed under the MIT License - see the LICENSE file for details.