Efficiently managing multiple Flutter SDK versions is critical for modern teams developing robust mobile apps. As Flutter evolves rapidly, inconsistent SDK versions can lead to complex compatibility issues—especially when APIs are central to your workflow. This guide will show you how to fully leverage Flutter Version Management (FVM) to keep projects stable, accelerate onboarding, and enable seamless collaboration.
Along the way, you'll discover how Apidog, a streamlined API development and testing platform, naturally fits into a productive Flutter workflow—empowering teams to design, document, mock, and test APIs with ease.
Why FVM Matters for Flutter Developers
Switching between Flutter SDK versions is a common challenge for teams who:
- Maintain multiple projects with different dependencies.
- Collaborate across diverse environments.
- Need to test new Flutter releases or channels without disrupting production.
- Require stable, reproducible builds for CI/CD.
FVM solves these by allowing you to easily install, manage, and switch between different Flutter SDK versions—per project or globally—ensuring every developer and automation system uses the intended version.
Streamlining API Testing with Apidog
While building Flutter apps, testing and integrating with APIs is essential. Apidog stands out as a modern alternative to Postman, designed for teams who need more than just API requests.
Key advantages of Apidog:
- Unified Workflow: Design, document, debug, test, and mock APIs in a single workspace.
- Easy Collaboration: Real-time editing and updates for distributed teams.
- Built-in Mock Server: Instantly create mock endpoints, speeding up frontend-backend development.
- OpenAPI Support: Import/export OpenAPI specs to match your contract-driven workflows.
- Auto-generated Documentation: Instantly generate interactive, shareable API docs.
- Advanced Testing: Script complex test scenarios, automate checks, and integrate with CI pipelines.
Setting Up FVM: Installation Guide
macOS
- Homebrew:
brew tap leoafarias/fvm brew install fvm - Install Script:
curl -fsSL https://fvm.app/install.sh | bash
Windows
- Chocolatey:
choco install fvm - Or download the standalone package from the FVM GitHub repository.
Linux
- Install Script:
curl -fsSL https://fvm.app/install.sh | bash
Global Activation
After installing FVM, activate it globally:
dart pub global activate fvm
Essential FVM Commands & Usage
Install Flutter Versions
Install a specific version:
fvm install 3.16.0
Or install a channel:
fvm install stable
fvm install beta
fvm install dev
Advanced: Install by commit hash:
fvm install fa345b1 # Short hash
fvm install 476ad8a917e6... # Full hash
Set Flutter Version Per Project
In your project directory:
fvm use 3.16.0
Creates .fvm folder and links the SDK.
Use the latest from a channel:
fvm use stable
Pin the channel to its current version:
fvm use stable --pin
Manage Installed Versions
List all installed versions:
fvm list
# or
fvm ls
See all available Flutter releases:
fvm releases
fvm releases --channel beta
Remove a version:
fvm remove 3.16.0
Set a global Flutter version:
fvm global 3.16.0
fvm global --unlink
Project Configuration: IDE & VCS Integration
Update .gitignore
Add FVM’s SDK link to .gitignore:
.fvm/flutter_sdk
Configure Your IDE
VS Code
Edit .vscode/settings.json:
{
"dart.flutterSdkPath": ".fvm/flutter_sdk",
"search.exclude": { "**/.fvm": true },
"files.watcherExclude": { "**/.fvm": true }
}
Android Studio
- Go to Languages & Frameworks > Flutter.
- Set the SDK path to
/absolute-project-path/.fvm/flutter_sdk. - To ignore the SDK in version control, add to
.idea/workspace.xml:<component name="VcsManagerConfiguration"> <ignored-roots> <path value="$PROJECT_DIR$/.fvm/flutter_sdk" /> </ignored-roots> </component>
Xcode (iOS)
In Build Phases > Run Script, add:
export FLUTTER_ROOT="$PROJECT_DIR/../.fvm/flutter_sdk"
Advanced FVM Workflows
Project Flavors
Assign different Flutter versions to different flavors:
fvm use 3.16.0 --flavor production
fvm use 3.10.0 --flavor development
Switch between flavors:
fvm use production
fvm use development
Run with a specific flavor:
fvm flavor production flutter build
Running Commands with Specific Versions
Run a Flutter command for a specific SDK:
fvm spawn 3.16.0 flutter build
fvm spawn 3.10.0 flutter test
Project-Scoped Commands
Execute scripts using your project's configured SDK:
fvm exec melos bootstrap
fvm exec ./path/to/script.sh
FVM in CI/CD
For reproducible CI builds:
- Install FVM
- Run
fvm install - Run Flutter commands via FVM
GitHub Actions Example:
steps:
- uses: actions/checkout@v3
- name: Install FVM
run: |
dart pub global activate fvm
fvm install
- name: Build and Test
run: |
fvm flutter pub get
fvm flutter test
Best Practices for FVM in Team Environments
- Always use FVM: Run all Flutter commands via FVM for consistency.
- Document Flutter versions: List required versions in your project README.
- Lock CI/CD versions: Match CI/CD pipeline versions to local dev versions.
- Use
--pinfor stability: Pin channels to avoid auto-updates. - Clean up regularly: Remove unused versions with
fvm removeto save space.
Troubleshooting: Smooth FVM Adoption
FVM Not Detected by IDE
- Double-check Flutter SDK path in IDE settings.
- Restart IDE after changes.
- Verify symlink presence:
ls -la .fvm/flutter_sdk.
Permission Issues
- For Unix-like systems, try
sudo fvm <command>. - Ensure correct permissions for FVM cache directories.
Path Problems
- Ensure
.fvm/flutter_sdkis in yourPATHif running scripts manually. - Use absolute paths in automation if needed.
Conclusion
FVM brings clarity and stability to modern Flutter development, allowing teams to confidently manage multiple SDK versions and avoid the “works on my machine” trap. By integrating FVM into your workflow—and pairing it with powerful API tools like Apidog—you can streamline project setup, enable safer experimentation, and deliver stable, API-driven mobile apps faster.
For teams where API design, testing, and documentation are critical, Apidog enhances your stack with all-in-one features designed for real-time collaboration and efficiency. As you harness the full potential of FVM, consider how Apidog can further optimize your API development lifecycle—making your entire workflow, from SDK management to API integration, more reliable and scalable.
Happy coding—and happy testing!



