Skip to content

A flutter translator app using Google Translate API. Cubit state management, dependency injection, retrofit, dio and get_it used with clean architecture

License

Notifications You must be signed in to change notification settings

AslihanYoldas/Flutter-Translator-App

Repository files navigation

Flutter Translator App

This is a Flutter-based Translator App designed to translate text and provide speech-to-text functionality. Users can input text, select languages, and receive translations seamlessly. The app uses Cubit for state management, dependency injection for modularization. The app leverages the power of Cubit state management and dependency injection to ensure a clean and maintainable codebase.

Features

  • Text Translation: Translate text between various languages.
  • Speech-to-Text: Recognize speech input and convert it into text.
  • Dynamic Theme: Switch between light and dark themes.
  • Animation: Implemented a custom Ripple Effect Animation to visually indicate microphone activation during speech input.

Usage

  1. Start the app and choose your source and target languages. Reverse languages as needed.
  2. Enter text manually or use the Speech-to-Text feature to input text by voice.
  3. Press "Translate" to view the translated output.
  4. Tap the copy icon to save the text to your clipboard.
  5. Toggle between light and dark themes as desired.

Releases

You can download the latest version of the app for both Android and iOS from the Releases section.

Android: Download the .apk file and install it on your Android device. iOS: Download the .ipa file and use tools like AltStore or Xcode to sideload it onto your iOS device.

Go to releases

Screenshots

Translator

main_page_light_mode main_page_dark_mode

Speech to Text

speech_to_text


Example Translations

main_page_light_mode main_page_dark_mode

Example Usage

  1. Activate Speech-to-Text Tap the mic button to enable speech-to-text functionality. Speak into the mic, and if you are satisfied with the input, press the "OK" button.



Speech-to-Text Result



2. Edit Text and Select Languages The recognized text will appear in the input field. You can edit the text and select the source and target languages and, if needed, reverse them.

Languages Selection



3. Translate and Copy Text Press the "Translate" button to see the translated text in the output field. To copy either the original or translated text, press the copy button.

Translation Result

API Integration

The app retrieves data from Text Translator through Rapid API. Network requests are managed using Retrofit and Dio for efficient data handling and real-time translations.

Architecture

The app follows a clean architecture pattern with Cubit for state management and get_it for dependency injection. This approach ensures:

  • Scalability: Easily add new features with minimal changes to the existing code.
  • Maintainability: Modularized components simplify debugging and testing.
  • Separation of Concerns: Clear boundaries between business logic, UI, and data handling.

State Management

The app’s state management is handled using Cubit from the flutter_bloc package:

  • TranslatorCubit: Manages the translation API call, loading, and result display.
  • SpeechCubit: Handles speech-to-text functionality.
  • ThemeCubit: Controls dynamic theme switching across the app.

Acknowledgments

  • Text Translator API : For providing translator functionality (API-link)
  • speech_to_text package : For recognizing speech input. (speech_to_text-link)
  • retrofit and dio packages: For network requests. (retrofit-link,dio-link)
  • flutter_bloc package : For the Cubit state management. (bloc-link)
  • get_it package : For dependency injection. (get_it-link)
  • Flutter : For the framework.

Contributing

Feel free to contribute by opening issues or submitting pull requests.

Contact

For questions or feedback, contact aslihanyoldas24@gmail.com

About

A flutter translator app using Google Translate API. Cubit state management, dependency injection, retrofit, dio and get_it used with clean architecture

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published