Using FVM Flutter Version with Shorebird Integration

Last updated: December 17, 2025

When using the Shorebird integration with CodeMagic's Workflow editor, you can also pick the Flutter version from your FVM configuration instead of hardcoding it in the workflow.

Implementation Steps

First, ensure your .fvmrc file is properly configured in your project root:

{
  "flutter": "3.22.0",
  "flavors": {
    "dev": "3.24.0",
    "prod": "3.22.0"
  },
  "runPubGetOnSdkChanges": true,
  "updateVscodeSettings": true,
  "updateGitIgnore": true
}

If using the Workflow Editor, add the following script to your pre-build script section to extract and set the Flutter version as an environment variable:

brew install jq
FLUTTER_VERSION_DEV=$(jq -r '.flavors.dev' .fvmrc)
FLUTTER_VERSION=$(jq -r '.flutter' .fvmrc)
echo "export FLUTTER_VERSION=$FLUTTER_VERSION" >> $CM_ENV

Finally, in your Shorebird build arguments, add the following flag to use the extracted version:

--flutter-version=$FLUTTER_VERSION

For YAML configuration, add this to your scripts:

- name: Install jq
  script: |
     brew install jq
- name: Shorebird Release
  script: |
     FLUTTER_VERSION_DEV=$(jq -r '.flavors.dev' .fvmrc)
     FLUTTER_VERSION= $(jq -r '.flutter' .fvmrc)
     echo $FLUTTER_VERSION
     shorebird release android --flutter-version=$FLUTTER_VERSION