verblaze_flutter 1.1.0
verblaze_flutter: ^1.1.0 copied to clipboard
Flutter SDK for Verblaze Translation Management System
Verblaze Flutter SDK #
Verblaze Flutter SDK is a powerful translation management system integration that allows you to easily manage multilingual support in your application. With this SDK, you can dynamically manage and update your translations.
Features #
- 🌍 Multi-language support
- 🚀 Easy integration
- 💾 Automatic caching
- 🔄 Automatic version control and updates
- 📱 Optimized for Flutter applications
- ⚡️ High-performance operation
- 🔌 Simple API integration
- 🎯 Auto-translated widgets
- 🔄 Robust error handling
Getting Started #
Installation #
Add Verblaze Flutter SDK to your pubspec.yaml file:
dependencies:
verblaze_flutter: ^1.1.0
Then run:
flutter pub get
Configuration #
Initialize the SDK in your application:
import 'package:verblaze_flutter/verblaze_flutter.dart';
// In your main widget's initState or at app startup
await Verblaze.configure('YOUR_API_KEY');
Usage #
Creating Auto-Translated Widgets #
You can create widgets that automatically update when the language changes by extending AutoTranslatedWidget:
class WelcomeScreen extends AutoTranslatedWidget {
const WelcomeScreen({super.key});
@override
Widget buildView(BuildContext context, VerblazeProvider provider) {
return Column(
children: [
Text('welcome.title'.vbt),
Text('welcome.description'.vbt),
],
);
}
}
The widget will automatically rebuild whenever the language changes, ensuring your UI stays in sync with the selected language.
Simple Translation #
// Using String extension
final translatedText = "home.welcome".vbt;
// Or for a specific language
final translatedText = "home.welcome".vbtWithLang('en');
Changing Language #
final provider = VerblazeProvider();
provider.setLanguage('en'); // Switch to English
Usage in Regular Widgets #
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Text(
'welcome_screen.title'.vbt,
style: TextStyle(fontSize: 24),
);
}
}
Advanced Usage #
Listing Supported Languages #
final provider = VerblazeProvider();
final languages = provider.supportedLanguages;
// List languages
for (var language in languages) {
print('${language.name} (${language.nativeName})');
}
Current Language Information #
final provider = VerblazeProvider();
final currentLang = provider.currentLanguageObject;
print('Current language: ${currentLang?.nativeName}');
Error Handling #
The SDK provides comprehensive error handling:
try {
final text = "invalid_key".vbt;
} on VerblazeException catch (e) {
print('Translation error: ${e.message}');
} on CacheException catch (e) {
print('Cache error: ${e.message}');
} on NetworkException catch (e) {
print('Network error: ${e.message}');
}
Contributing #
We welcome contributions! Please follow these steps:
- Fork this repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Create a Pull Request
License #
This project is licensed under the MIT License. See the LICENSE file for details.
Support #
- Documentation: Verblaze Documentations
- Report issues: GitHub Issues
- Email: support@verblaze.com
Security #
If you discover a security vulnerability, please send an email to info@verblaze.com