D
DevOps & CI/CDEasy20 XP3 min read

How do you manage Flutter version in a team and CI/CD pipeline?

TL;DR: Use FVM (Flutter Version Manager) to pin the Flutter SDK version per project. Commit .fvm/fvm_config.json. In CI, use subosito/flutter-action@v2 with flutter-version from .fvmrc or cache-key for fast builds.

Full Answer

Without version pinning, different team members run different Flutter versions — 'works on my machine' issues arise. FVM solves this by pinning the version per project.

FVM Setup

  • dart pub global activate fvm
  • fvm use 3.29.0 (pins version for project)
  • Commit .fvmrc and .fvm/fvm_config.json
  • Use 'fvm flutter run' / 'fvm flutter build' instead of 'flutter'
🎯

Add .fvm/flutter_sdk to .gitignore — the SDK itself (hundreds of MB) should not be committed, only the version config file.

Code Examples

yamlGitHub Actions with FVM + caching
Output
// Flutter version pinned from .fvmrc
// SDK cached: subsequent CI runs are ~3x faster
// pub cache: dependencies cached per pubspec.lock hash

Common Mistakes

  • Not committing .fvmrc — team members get different Flutter versions
  • Not caching the Flutter SDK in CI — each run downloads 500MB+ unnecessarily

Interview Tip

💡

FVM + GitHub Actions caching can reduce CI build time from 10+ minutes to under 3 minutes for subsequent runs. Demonstrating this optimization shows production CI/CD experience.

#fvm#flutter-version#team#CI/CD