A Flutter-based speech-to-text application with AI-powered chat functionality using Google's Gemini API.
- Speech Recognition - Convert speech to text using device microphone
- AI Chat - Get intelligent responses from Gemini AI
- TTS (Text-to-Speech) - Listen to AI responses
- History Management - Save and manage chat sessions with Hive
- Dark/Light Theme - Theme switching support
- Copy & Share - Easy sharing of responses
lib/
├── core/
│ ├── constants/ # App constants
│ ├── providers/ # Riverpod providers (theme)
│ ├── router/ # Navigation routing
│ └── theme/ # App theming
├── data/
│ ├── models/ # Data models (Hive)
│ └── repositories/ # Data repositories
├── domain/
│ └── services/ # Business services
│ ├── permission_service.dart
│ ├── speech_service.dart
│ └── export_service.dart
├── features/
│ └── chat/
│ ├── domain/
│ │ ├── controllers/ # Riverpod controllers
│ │ ├── entities/ # Chat message entity
│ │ └── states/ # State classes
│ └── presentation/
│ ├── controllers/ # Speech controller
│ ├── screens/ # App screens
│ └── widgets/ # Reusable widgets
└── main.dart
This project uses flutter_dotenv to manage API keys securely.
-
Create a
.envfile in the project root:GEMINI_API_KEY=your_api_key_here -
Add
.envto.gitignoreto prevent committing your API key.
- Flutter SDK 3.10+
- Dart SDK 3.10+
- Android SDK / Xcode (for iOS)
# Install dependencies
flutter pub get
# Run the app
flutter runAndroid:
flutter build apk --releaseiOS:
flutter build ios --release| Layer | Class | Description |
|---|---|---|
| Domain | ChatController |
Manages chat state and AI interactions |
| Domain | HistoryController |
Manages chat history |
| Domain | ChatMessage |
Chat message entity |
| Domain | HistoryState |
History list state |
| Presentation | ChatScreen |
Main chat interface |
| Presentation | HistoryDrawer |
Side drawer with chat history |
| Presentation | ChatMessageBubble |
Message display widget |
| Presentation | ResponseActions |
Action buttons (speak, copy, share) |
| Presentation | MessageComposer |
Text input area |
- Start Chat: Tap the + button in app bar to start a new session
- Speak: Tap the microphone button and speak
- Send: Tap the send button (➕ rotated 45°)
- Listen: Tap the speaker icon on AI responses
- Copy: Tap the copy icon to copy to clipboard
- Share: Tap the share icon to share
- History: Open the drawer to view past sessions
speech_to_text- Speech recognitionflutter_riverpod- State managementhive/hive_flutter- Local storagegoogle_generative_ai- Gemini AI integrationflutter_tts- Text-to-speechflutter_markdown- Markdown renderingshare_plus- Share functionalitypermission_handler- Runtime permissions
MIT License