Dr.AI is a proof-of-concept Flutter application that simulates an AI-driven "smart doctor" chat experience. It integrates speech recognition, text-to-speech, and AI-based chat functionalities to demonstrate how users might interact with a health-related assistant. Developed as part of a final-year project, this application is not intended for production or real-world medical diagnosis.
-
AI Chat Interface
- Chat with an AI assistant using text or images.
- The AI can respond based on configured models and system prompts.
-
Speech Recognition and TTS (Optional)
- Use speech-to-text (STT) via the microphone to transcribe user input.
- Use text-to-speech (TTS) to read out the AI's responses.
-
Multiple Chat Sessions
- Create new chat sessions and store previous chats locally for reference or re-use.
- Supports naming and managing stored chat sessions.
-
Basic Settings & Customization
- Change themes (light/dark) and color schemes (dynamic color is supported).
- Configure application behavior (e.g., system prompt, markdown usage, request type).
- Configure host URL for connecting to an AI service.
-
Exports & Imports
- Export chat histories to JSON.
- Import chat histories retrieved from others.
-
Voice Mode (Experimental)
- Voice-based continuous conversation loop where the AI automatically responds with TTS and awaits further STT commands.
-
Self-Trained Medical AI Model
- Custom fine-tuned Google Gemma 3 model using LoRA (Low-Rank Adaptation).
- Trained with HealthCareMagic dataset containing 100k real doctor-patient conversations.
- Specialized in understanding and responding to medical queries with clinical context.
-
Vaccines Record
- Store and manage your vaccination history.
- Track upcoming vaccination schedules and past records.
-
Medicine Calendar
- Set reminders for medication schedules.
- Manage and track your daily medicine intake.
-
Medical Certificate
- Store and organize your medical certificates digitally.
- Easily access and share your medical documentation when needed.
- Main Chat Screen – Central interface for chatting with the AI assistant, uploading images, or toggling voice mode.
- Settings Screen – Configure the host, enable or disable voice, tweak chat behavior, or manage interface options.
- Voice Screen – A dark-themed, experimental window for continuous speech-based conversations.
- Export & Import Screen – Allows saving or retrieving JSON chat logs.
- About Screen – Provides disclaimers, license info, and links for further information.
- Vaccines Record Screen – View and manage vaccination history, add new records, and track upcoming vaccines.
- Medicine Calendar Screen – Set medication reminders, track medicine intake schedules, and manage prescriptions.
- Medical Certificate Screen – Store, view, and manage digital medical certificates with document organization features.
Below is a condensed overview of the main files and folders. Refer to the code for detailed implementation:
lib
├── l10n
│ ├── app_en.arb
│ ├── app_localizations.dart
│ ├── app_localizations_en.dart
│ ├── app_localizations_zh.dart
│ └── app_zh.arb
├── main.dart
├── models
│ └── medical_certificate_model.dart
├── screens
│ ├── calendar
│ │ ├── screen_add_calendar.dart
│ │ ├── screen_calendar.dart
│ │ └── screen_calendar_list.dart
│ ├── guide
│ │ ├── screen_guide_ai_chat.dart
│ │ ├── screen_guide_bmi.dart
│ │ ├── screen_guide_calendar.dart
│ │ ├── screen_guide_calendar_add_edit.dart
│ │ ├── screen_guide_calendar_list.dart
│ │ ├── screen_guide_frame.dart
│ │ ├── screen_guide_medical_certificate.dart
│ │ ├── screen_guide_medical_certificate_add.dart
│ │ ├── screen_guide_page_medical_3.dart
│ │ ├── screen_guide_page_medical_4.dart
│ │ ├── screen_guide_page_medical_5.dart
│ │ ├── screen_guide_sample.dart
│ │ └── screen_guide_vaccine_record.dart
│ ├── medical_certificate
│ │ ├── screen_add_medical_certificate.dart
│ │ ├── screen_medical_certificate_detail.dart
│ │ └── screen_medical_certificate_record.dart
│ ├── screen_auth.dart
│ ├── screen_bmi.dart
│ ├── screen_settings.dart
│ ├── screen_voice.dart
│ ├── settings
│ │ ├── settings_about.dart
│ │ ├── settings_behavior.dart
│ │ ├── settings_export.dart
│ │ ├── settings_interface.dart
│ │ └── settings_voice.dart
│ └── vaccine
│ ├── screen_add_vaccine_record.dart
│ ├── screen_vaccine_detail.dart
│ └── screen_vaccine_record.dart
├── services
│ ├── ocr_service.dart
│ ├── service_auth.dart
│ ├── service_calendar_event.dart
│ ├── service_crop_image.dart
│ ├── service_demo.dart
│ ├── service_desktop.dart
│ ├── service_guide.dart
│ ├── service_haptic.dart
│ ├── service_notification.dart
│ ├── service_sender.dart
│ ├── service_setter.dart
│ └── service_theme.dart
├── utils
│ └── form_validators.dart
└── widgets
├── widgets_screens
│ ├── calendar
│ │ └── widget_calendar.dart
│ ├── medical_certificate
│ │ ├── widget_add_medical_certificate.dart
│ │ ├── widget_medical_certificate_detail.dart
│ │ └── widget_medical_certificate_record.dart
│ ├── vaccine
│ │ ├── widget_add_vaccine_record.dart
│ │ ├── widget_vaccine_detail.dart
│ │ └── widget_vaccine_record.dart
│ ├── widget_main.dart
│ ├── widget_screen_settings.dart
│ ├── widget_vaccine_detail.dart
│ └── widgets_settings
│ ├── widget_about.dart
│ ├── widget_behavior.dart
│ ├── widget_export.dart
│ └── widget_interface.dart
├── widgets_units
│ ├── widget_button.dart
│ ├── widget_title.dart
│ └── widget_toggle.dart
└── widgets_workers
└── widget_desktop.dart
-
Clone this repository:
git clone https://github.com/old-cookie/dr_ai cd DrAI
-
Install dependencies via Flutter:
flutter pub get
-
Run the app on a connected device or emulator:
flutter run
-
(Optional) Configure a local or remote AI host if needed. See Configuration.
-
Launch the App
After running the Flutter app, the Main Chat Screen will appear. -
Chat with the Assistant
- Type your message in the input field at the bottom, or tap the attachment icon if voice mode is enabled or if you wish to send an image.
- The AI responds within the chat window.
-
Manage Chats
- Hover or long-press (on mobile) on chats in the sidebar to rename or delete them.
- Create a new chat with the "New Chat" option.
-
Adjust Settings
- Access the Settings Screen to configure host, theme, AI behavior, and other advanced options.
- In the "Voice" tab, enable the experimental voice mode if you want to speak or have the AI read aloud its responses.
-
Host
The app can connect to a local or remote AI service (e.g., an Ollama server). By default, the code references "http://localhost:11434". Modify under "Settings" or set the const variables in main.dart for a fixed setup. -
Model
The AI model can be selected through the model selection dialog (if enabled). Alternatively, a default model can be set in main.dart. -
Voice Mode
Voice functionality depends on microphone permission and TTS availability. Under "Settings > Voice," you can enable or disable it, change languages, and control punctuation rules.
Key packages used in this project:
- Flutter Chat UI – Chat interface components.
- Ollama Dart – Open-source library for connecting to an Ollama-based AI service.
- Speech to Text – Speech recognition (STT).
- Flutter TTS – Text-to-speech.
- File Picker – Image selection, JSON import.
- And more (see pubspec.yaml for the full list).
- AI Chat
- Vaccines Record
- Medicine calendar
- Medical Certificate
This project is a final-year academic demonstration and should not be used as a medical tool or to provide real-world health advice. Data privacy and security are not guaranteed. Always consult a qualified healthcare professional for any medical concerns.