A Flutter-based mobile application designed for seamless and intuitive text translation. This application allows users to translate text between a wide variety of languages, featuring a clean user interface with support for both light and dark themes.
- Real-time Text Translation: Utilizes the
translator
package (leveraging Google Translate) for accurate and fast translations. - Multi-language Support:
- Loads an extensive list of supported and target languages from a local JSON configuration (
assets/lang.json
). - Includes an "Auto Detect" feature for the source language.
- Loads an extensive list of supported and target languages from a local JSON configuration (
- Dual Theme System:
- Offers both light and dark themes for user preference.
- Theme selection is persisted across app sessions using
SharedPreferences
. - Custom-defined
ThemeData
for a polished look and feel in both modes.
- User-Friendly Interface:
- Introduction Page: Welcomes users with the app logo, a brief description, and easy navigation to the translation screen.
- Translation Page: Provides intuitive controls for language selection, text input, and viewing translated output.
- Visual feedback for loading states and error messages.
- Custom Styling: Incorporates Google Fonts for enhanced typography.
- Error Handling: Implements mechanisms to manage and display errors during translation or language data loading.
- Language Service (
LanguageService
): Manages the loading and caching of language lists fromassets/lang.json
, optimizing performance. - Theme Management (
_MyTranslatorAppState
): Handles theme state, persistence, and toggling logic. - UI Widgets:
MyTranslatorApp
: The root widget, setting upMaterialApp
and theme configurations.IntroductionPage
: The initial landing screen.TranslationPage
: The primary interface for all translation tasks.AppFooter
: A consistent footer element.
- Flutter: For cross-platform mobile application development.
- Dart: The programming language for Flutter.
- Packages:
translator
: For core translation functionality.shared_preferences
: For persisting theme preferences.google_fonts
: For custom font integration.flutter/services
(rootBundle): For loading local asset files (e.g.,lang.json
).
- Flutter SDK: Installation Guide
- An IDE like Android Studio or VS Code with Flutter plugins.
- Clone the repository:
- Ensure
assets/lang.json
is present: This file should contain a JSON array of language objects, each with acode
andname
. Example: - Add
assets/logo.png
to theassets
folder. - Update
pubspec.yaml
to include your assets: - Get dependencies:
- Run the application:
- Upon launching the app, you will be greeted by the Introduction Page.
- Tap the "Lets Translate" button to navigate to the Translation Page.
- On the Translation Page:
- Select the source language from the "From" dropdown (or leave as "Auto Detect").
- Select the target language from the "To" dropdown.
- Enter the text you wish to translate in the input field.
- Tap the "Translate" button.
- The translated text will appear in the designated area below.
- Toggle between light and dark themes using the theme icon in the AppBar on either page.
- Refined light theme color palette.
- Integrated Google Fonts for improved text presentation.
- Enhanced code comments for better maintainability and developer understanding.
- Addressed various minor bugs and improved overall application stability.
- Added a clear all button on the translation page.
- Initial application setup.
- Implementation of core light and dark mode functionality.
- Development of the translation engine and basic error handling.
- Addition of app footers and foundational code commenting.
- Offline translation capabilities.
- Voice input for translation.
- Saving translation history.
- More robust error reporting and retry mechanisms.
Here are some screenshots of the application: