VoiceFlow Diary is a next-generation journaling application that combines traditional diary keeping with cutting-edge AI voice technology. Built with Flutter and powered by Firebase Vertex AI (Gemini), it offers multiple ways to capture your daily momentsโfrom traditional typing to hands-free voice conversations.
VoiceFlow Diary offers three distinct voice interaction modes for maximum flexibility:
| Feature | Gemini Live | Traditional | Voice Note |
|---|---|---|---|
| Latency | <1 second | 3-5 seconds | 2-4 seconds |
| Interaction | Continuous | Start/Stop | Single shot |
| Response Type | Voice | Text | Processed entry |
| Best For | Natural chat | Deliberate commands | Quick capture |
| Network Usage | Higher | Medium | Medium |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ฑ VoiceFlow Diary โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ ๐ฎ Live Voice Assistant (Large Purple Button) โ
โ โ Real-time conversation with Gemini โ
โ โ
โ ๐ค Traditional Assistant (Deep Purple) โ
โ โ Record โ Process โ Respond โ
โ โ
โ ๐๏ธ Voice Command (Teal) โ
โ โ Quick diary entry creation โ
โ โ
โ โ๏ธ Manual Entry (Primary Color) โ
โ โ Traditional typing โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
git clone https://github.com/weincoder/agentic-flutter-vertex.git
cd agentic-flutter-vertex/example
flutter pub get
# Install FlutterFire CLI
dart pub global activate flutterfire_cli
# Configure Firebase for your project
flutterfire configure
gemini-1.5-flash (Chat)gemini-2.0-flash-live-preview-04-09 (Live)imagen-3.0-generate-002 (Images)Configure permissions
iOS (ios/Runner/Info.plist):
<key>NSMicrophoneUsageDescription</key>
<string>VoiceFlow Diary needs microphone access to record voice notes</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>VoiceFlow Diary uses speech recognition to transcribe your voice</string>
Android (android/app/src/main/AndroidManifest.xml):
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.INTERNET"/>
# iOS
flutter run -d ios
# Android
flutter run -d android
# Web
flutter run -d chrome
# Desktop
flutter run -d macos # or windows, linux
lib/
โโโ main.dart # App entry point
โโโ config/
โ โโโ app/
โ โ โโโ app.dart # Root app widget with Provider
โ โโโ data/
โ โ โโโ database_helper.dart # SQLite database setup
โ โ โโโ diary_repository.dart # Data access layer
โ โโโ firebase/
โ โ โโโ firebase_options.dart # Firebase configuration
โ โโโ ia/
โ โ โโโ app_agents/
โ โ โ โโโ diary_agent.dart # Diary entry AI agent
โ โ โ โโโ image_generator.dart # Imagen 3.0 integration
โ โ โ โโโ voice_assistant_agent.dart # Voice command processor
โ โ โโโ models/
โ โ โโโ ia_models.dart # AI model configurations
โ โโโ models/
โ โ โโโ diary_entry.dart # Data models
โ โโโ state/
โ โโโ app_state.dart # Global app state (Provider)
โโโ ui/
โโโ pages/
โ โโโ diary_home_page.dart # Main screen
โ โโโ new_entry_page.dart # Entry editor
โโโ widgets/
โโโ entry_card.dart # Entry display card
โโโ image_viewer.dart # Full-screen image viewer
โโโ live_voice_assistant.dart # Gemini Live integration
โโโ voice_assistant_button.dart # Traditional voice assistant
โโโ voice_command_button.dart # Voice note creation
โโโ voice_commands_help_dialog.dart # Help dialog
firebase_ai: ^3.6.1gemini-1.5-flash: Text generation and analysisgemini-2.0-flash-live-preview-04-09: Real-time audio streamingimagen-3.0-generate-002: Image generation^6.1.2 - Audio recording^3.4.7 - Audio playback (for Gemini Live)^0.2.2 - Audio session management^6.1.5+1 - Reactive state management^2.4.1 - Local SQLite databaseโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ User Input โ
โ (Voice / Text / Traditional Commands) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Voice Processing โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ Gemini Live โ โ Traditional โ โ Voice Note โ โ
โ โ (Streaming) โ โ (Recording) โ โ (Capture) โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Gemini AI Processing โ
โ โข Transcription โข Analysis โข Classification โ
โ โข Content Generation โข Function Calling โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโ
โ Action โ โ Store โ โ Image โ
โ (Theme)โ โ Entry โ โ Gen โ
โโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ App State / Database โ
โ (Provider notifies UI updates) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโ
โ UI Updateโ
โโโโโโโโโโโโ
Located in /example:
"Cambia el color a azul"
"Pon la app en rojo"
"Quiero el tema morado"
"ยฟQuรฉ tiempo hace hoy?"
"ยฟCuรกl es la capital de Francia?"
"Explรญcame quรฉ es la fotosรญntesis"
"Resume mi semana"
"Muestra un resumen del mes"
"ยฟQuรฉ escribรญ hoy?"
"Elimina la รบltima entrada"
"Borra la entrada de ayer"
class DiaryAgent {
// Analyze diary content
Future<Map<String, dynamic>> analyzeContent(String content);
// Generate entry title
Future<String> generateTitle(String content);
// Extract emotions
Future<List<String>> detectEmotions(String content);
// Generate tags
Future<List<String>> generateTags(String content);
}
class VoiceAssistantAgent {
// Process voice command
Future<VoiceCommandResult> processCommand(String audioPath);
// Command types
enum VoiceCommandType {
colorChange,
question,
summary,
deleteEntry,
unknown,
}
}
class LiveVoiceAssistant {
// Function declarations for Gemini Live
- setAppColor(color: String)
- getDiarySummary(timeRange: String)
- deleteEntry(target: String)
}
The app supports dynamic theming via voice commands. Available colors:
| Spanish | English | Color Code |
|---|---|---|
| rojo | red | Colors.red |
| azul | blue | Colors.blue |
| verde | green | Colors.green |
| morado | purple | Colors.purple |
| naranja | orange | Colors.orange |
| rosa | pink | Colors.pink |
| turquesa | teal | Colors.teal |
| รญndigo | indigo | Colors.indigo |
| cafรฉ | brown | Colors.brown |
| รกmbar | amber | Colors.amber |
Edit voice settings in live_voice_assistant.dart:
LiveGenerationConfig(
speechConfig: SpeechConfig(
voiceName: 'Achernar', // Change voice
),
responseModalities: [ResponseModalities.audio],
)
Available voices: Check Google Cloud TTS documentation
Modify audio configuration in voice widgets:
RecordConfig(
encoder: AudioEncoder.pcm16bits,
sampleRate: 24000, // Adjust sample rate
numChannels: 1, // Mono/Stereo
echoCancel: true, // Echo cancellation
noiseSuppress: true, // Noise suppression
)
Create a .env file (if needed for future enhancements):
FIREBASE_PROJECT_ID=your-project-id
VERTEX_AI_LOCATION=us-central1
Edit firebase_options.dart after running flutterfire configure:
static const FirebaseOptions currentPlatform = FirebaseOptions(
apiKey: 'your-api-key',
projectId: 'your-project-id',
messagingSenderId: 'your-sender-id',
appId: 'your-app-id',
// ... platform-specific options
);
flutter test
flutter test integration_test/
flutter analyze
| Metric | Gemini Live | Traditional | Voice Note |
|---|---|---|---|
| Response Time | <1s | 3-5s | 2-4s |
| Token Usage | 2-3x higher | Medium | Medium |
| Network Bandwidth | High (streaming) | Medium | Medium |
| Battery Impact | Higher | Medium | Low |
| Accuracy | Excellent | Excellent | Excellent |
We welcome contributions! Please follow these guidelines:
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-featureflutter format before committingThis project is licensed under the MIT License - see the LICENSE file for details.