All essential Flutter commands organized by category and frequency of use.
| Command | Purpose | Frequency |
|---|---|---|
| Model Generation | ||
flutter pub run build_runner build --delete-conflicting-outputs |
Generate .g.dart files (one-time) | After model changes |
flutter pub run build_runner watch --delete-conflicting-outputs |
Auto-generate on file save | During active development |
flutter pub run build_runner clean |
Clean generated files | When conflicts occur |
| Code Quality | ||
dart format . |
Format all Dart files | Before commit |
dart format lib/ |
Format specific directory | As needed |
flutter analyze |
Check for errors and warnings | Before PR |
| Running App | ||
flutter run |
Run in debug mode | Daily |
flutter run --profile |
Run in profile mode | Performance testing |
flutter run --release |
Run in release mode | Testing production build |
flutter run -d device_id |
Run on specific device | Multi-device testing |
flutter devices |
List available devices | When checking devices |
| Building | ||
flutter build apk --debug |
Build debug APK | Testing |
flutter build apk --release |
Build release APK | Production |
flutter build apk --split-per-abi |
Build split APKs (smaller size) | Play Store upload |
flutter build appbundle --release |
Build App Bundle for Play Store | Play Store upload |
flutter build ios --release |
Build iOS release | App Store upload |
| Dependencies | ||
flutter pub get |
Install dependencies | After clone/checkout |
flutter pub upgrade |
Update all packages | Monthly maintenance |
flutter pub upgrade package_name |
Update specific package | As needed |
flutter pub outdated |
Check outdated packages | Monthly review |
| Testing | ||
flutter test |
Run all tests | Before PR |
flutter test test/widget_test.dart |
Run specific test file | During development |
flutter test --coverage |
Run tests with coverage | CI/CD pipeline |
| Debugging | ||
flutter doctor |
Check environment setup | Setup issues |
flutter doctor -v |
Verbose environment check | Detailed diagnostics |
flutter logs |
View app logs | Debugging |
flutter attach |
Attach to running app | Remote debugging |
| Cleanup | ||
flutter clean |
Clean build cache | Build errors |
flutter clean && flutter pub get |
Clean and reinstall | Weird build issues |
| Platform-Specific | ||
flutter open android |
Open Android in Android Studio | Android development |
flutter open ios |
Open iOS in Xcode | iOS development |
flutter emulators |
List Android emulators | Starting emulator |
flutter emulators --launch emulator_id |
Launch specific emulator | Testing |
xcrun simctl list devices |
List iOS simulators | iOS testing |
| Troubleshooting | ||
killall -9 dart |
Kill stuck Dart process | Lock file issues |
cd android && ./gradlew clean && cd .. |
Clean Android build | Gradle errors |
cd ios && pod deintegrate && pod install && cd .. |
Reinstall iOS pods | Pod errors |
| Workflow | Commands |
|---|---|
| Start Working | git pullflutter pub get |
| Before Commit | dart format .flutter analyze |
| After Model Changes | flutter pub run build_runner build --delete-conflicting-outputs |
| Build Broken | flutter cleanflutter pub getflutter pub run build_runner build --delete-conflicting-outputs |
This document describes the Git branching strategy and workflow for the Gymtaar project.
The following branches are protected and have strict access controls:
main- Production-ready codedev- Testing and staging environment
✅ No Direct Pushes - No one is allowed to push directly to main or dev
✅ Pull Request Required - All changes must go through pull requests (PRs)
✅ Code Review Required - All PRs must be reviewed before merging
✅ CI/CD Checks - All automated tests must pass before merging
main (production)
↑
└── dev (testing/staging)
↑
├── feature/presence
├── feature/profile
├── bugfix/login-issue
└── bugfix/chat-crash
- Always create branches from
dev(never frommain) - Work on your feature/bug fix in your dedicated branch
- Create a PR to merge into
devwhen ready - Test thoroughly in
devenvironment - After successful testing, maintainers will create a PR from
dev→main
- Review and merge feature/bugfix PRs into
dev - Test features in the
devenvironment - Create PRs from
dev→mainfor production releases
Use descriptive, lowercase names with hyphens as separators.
Format: feature/<feature-name>
Examples:
feature/presencefeature/profilefeature/chat-improvementsfeature/realtime-databasefeature/video-call-uifeature/subscription-system
Format: bugfix/<issue-name>
Examples:
bugfix/localstorage-databugfix/login-refresh-issuebugfix/call-not-workingbugfix/chat-crashbugfix/firebase-connection
git checkout devgit pull origin devgit checkout -b feature/presence# Make your changes
git add .
git commit -m "feat: add presence tracking feature"Commit Message Convention:
feat:for new featuresfix:for bug fixesdocs:for documentationrefactor:for code refactoringtest:for adding tests
git push -u origin feature/presence- Go to GitHub/GitLab
- Create a PR from
feature/presence→dev - Add description of changes
- Request review from team members
- Address review comments
- Once approved, merge into
dev
- Team tests the feature in
devenvironment - Fix any issues that arise
- After successful testing, maintainers create PR:
dev→main - Deploy to production
| Type | Branch Name Example | Purpose | Merges Into |
|---|---|---|---|
| Feature | feature/presence |
Add new presence system | dev |
| Feature | feature/profile |
Add profile management | dev |
| Feature | feature/chat-improvements |
Improve chat functionality | dev |
| Bug Fix | bugfix/localstorage-data |
Fix local storage saving issue | dev |
| Bug Fix | bugfix/login-refresh-issue |
Fix login token refresh | dev |
| Bug Fix | bugfix/call-not-working |
Fix video call connection | dev |
| Rule | Description |
|---|---|
🔴 main = Production |
Stable, production-ready code only |
🟡 dev = Testing |
Testing and staging environment |
🟢 feature/xxx |
New features and enhancements |
🔵 bugfix/xxx |
Bug fixes and issue resolutions |
| ❌ No Direct Push | Never push directly to dev or main |
| ✅ PR Required | All work must be submitted via Pull Request |
🔄 Flow: feature → dev → main |
Changes flow through testing before production |
# Get latest dev
git checkout dev
git pull origin dev
# Create your branch
git checkout -b feature/your-feature-name
# Or for bug fixes
git checkout -b bugfix/your-issue-namegit add .
git commit -m "feat: descriptive commit message"
git push -u origin feature/your-feature-name# While on your feature branch
git fetch origin
git rebase origin/dev
# Or use merge if preferred
git merge origin/dev# After your PR is merged, delete local branch
git checkout dev
git pull
git branch -d feature/your-feature-name
# Delete remote branch (if not auto-deleted)
git push origin --delete feature/your-feature-name- Never commit directly to
mainordev- Always use PRs - Keep branches focused - One feature or fix per branch
- Write descriptive commit messages - Help others understand your changes
- Update your branch regularly - Rebase or merge from
devto avoid conflicts - Delete merged branches - Keep the repository clean
- Test locally first - Don't push broken code
- Request reviews early - Get feedback while developing
If you have questions about the workflow:
- Ask in the team chat
- Review existing PRs for examples
- Contact the project maintainers
Last Updated: December 6, 2024
Maintained By: Gymtaar Development Team