# Flutter Development Setup Guide ## Quick Start (Linux Machine) 1. **Copy project to Linux machine:** ```bash # If using scp from Windows to Linux scp -r w:\Downloads\PROG+HTML\1356 user@linux-machine:/path/to/ # Or use rsync rsync -av /w/Downloads/PROG+HTML/1356/ user@linux-machine:/path/to/1356/ ``` 2. **Navigate to project:** ```bash cd /path/to/1356/lifetimer ``` 3. **Install dependencies:** ```bash flutter pub get ``` 4. **Run the app:** ```bash # With emulator flutter run # Or build APK flutter build apk --debug ``` ## Changes Made Summary ### ✅ Fixed Issues: 1. **JSON Coercion Error**: Added null safety in `mistral_ai_service.dart` 2. **Privacy Mode**: Changed default to `false` for better AI personalization 3. **Account Creation**: Added optional height/weight fields 4. **AI Formatting**: Added markdown rendering for better text display 5. **Loading Status**: Added "AI is thinking..." indicator in chat ### 📦 Dependencies Added: - `flutter_markdown: ^0.7.3` for formatted AI responses ### 🔧 Modified Files: - `lib/features/ai_chat/application/ai_chat_controller.dart` - `lib/features/ai_chat/presentation/ai_chat_screen.dart` - `lib/data/services/mistral_ai_service.dart` - `lib/data/models/user_model.dart` - `lib/features/auth/presentation/sign_up_screen.dart` - `lib/data/repositories/auth_repository.dart` - `lib/features/auth/application/auth_controller.dart` - `pubspec.yaml` ## Testing the Changes ### On Linux Machine: ```bash # 1. Get dependencies flutter pub get # 2. Check for any analysis issues flutter analyze # 3. Run tests flutter test # 4. Run the app flutter run # 5. Or build for testing flutter build apk --debug ``` ### Manual Testing Checklist: - [ ] Sign up with optional height/weight fields - [ ] Verify AI chat shows formatted responses - [ ] Check loading indicator appears when AI responds - [ ] Confirm privacy mode is off by default - [ ] Test that JSON errors no longer occur ## Flutter Installation (Linux) If you need to install Flutter on Linux: ```bash # Download Flutter wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.19.6-stable.tar.xz # Extract tar xf flutter_linux_3.19.6-stable.tar.xz # Add to PATH export PATH="$PATH:`pwd`/flutter/bin" # Verify installation flutter doctor # Install dependencies (Ubuntu/Debian) sudo apt-get update sudo apt-get install -y curl git unzip xz-utils libglu1-mesa ``` ## Project Structure ``` lifetimer/ ├── lib/ │ ├── features/ │ │ ├── ai_chat/ │ │ ├── auth/ │ │ └── ... │ ├── data/ │ │ ├── models/ │ │ ├── services/ │ │ └── ... │ └── ... ├── pubspec.yaml └── ... ``` The changes are ready to test once you run them on your Linux machine!