Zeba Academy Smart Localization
š Zeba Academy Smart Localization is a lightweight Flutter package that provides automatic locale detection, offline translation, voice input, text-to-speech, accessibility helpers, and dynamic font scaling ā all in one simple toolkit.
This package is designed to help Flutter developers build accessible and multilingual applications quickly without complex configuration or heavy dependencies.
⨠Features
š Automatic Locale Detection Detect the user's device language and adapt your app content accordingly.
š Text-to-Speech (TTS) Convert translated text into speech with multi-language support.
š¤ Voice Input Forms Capture voice input and convert speech into text easily.
š Offline Translation System Translate predefined phrases without relying on external APIs.
š¤ Dynamic Font Scaling Automatically adjust text size based on user accessibility preferences.
šØ Accessibility & Theme Helpers Detect contrast and improve readability automatically.
š¦ Installation
Add this package to your pubspec.yaml:
dependencies:
zeba_academy_localization: ^1.0.0
Then run:
flutter pub get
š Quick Start
Import the package:
import 'package:zeba_academy_localization/zeba_academy_localization.dart';
š Detect Device Locale
Locale locale = LocaleHelper.getDeviceLocale(context);
print(locale.languageCode);
š Offline Translation
String translated = OfflineTranslation.translate(
"Hello",
locale,
);
print(translated);
š Text-to-Speech
final tts = TTSHelper();
await tts.speak(
"Hello World",
languageCode: "en",
);
š¤ Voice Input
final voice = VoiceInputHelper();
await voice.init();
String? text = await voice.listen();
print(text);
š¤ Dynamic Font Scaling
Text(
"Hello",
style: TextStyle(
fontSize: FontHelper.getScaledFontSize(context, 18),
),
)
šØ Accessibility Helper
bool isDark = ThemeHelper.isDarkColor(Colors.blue);
š± Example
The package includes a fully working example app demonstrating:
- Voice input
- Translation
- Text-to-speech
- Locale detection
- Dynamic font scaling
Run the example:
cd example
flutter run
šø Screenshots
Add screenshots inside:
/screenshots/demo1.png
/screenshots/demo2.png
Example preview:
| Voice Input | Translation |
|---|---|
| Screenshot | Screenshot |
š§© Use Cases
This package is perfect for:
ā Multilingual apps ā Accessibility-focused apps ā Educational apps ā Voice-enabled applications ā Offline-friendly applications
š¤ Contributing
Contributions are welcome!
If you'd like to improve this package:
- Fork the repository
- Create a feature branch
- Submit a pull request
š License
This project is licensed under the GNU General Public License v3.0.
šØāš» About Me
⨠Iām Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects. You can learn more about me and my work at sufyanism.com or connect with me on Linkedin
š Zeba Academy
Your all-in-one no-bloat hub!
š Explore cutting-edge resources in coding, tech, and development at zeba.academy and code.zeba.academy. Empower yourself with practical skills through curated directives, real-world projects, and hands-on experience. Level up your tech game today! š»āØ
Zeba Academy is a learning platform dedicated to coding, technology, and development.
ā” Visit our main site: https://zeba.academy ā” Explore hands-on courses and resources at: https://code.zeba.academy ā” Check out our YouTube for more tutorials: https://www.youtube.com/@zeba.academy ā” Follow us on Instagram: https://www.instagram.com/zeba.academy/
ā If you like this package, please give it a star on GitHub and share it with other developers!
Thank you for visiting!