Use Flutter version from pubspec.yaml or FVM config
mainSet the Flutter version automatically by pointing to a configuration file like pubspec.yaml, .fvmrc, or .fvm/fvm_config.json using the flutter-version-file input.
Requirement: For pubspec.yaml, the version must be an exact match in the environment.flutter field (e.g., 3.19.0), not a range (e.g., ">= 3.19.0 <4.0.0").
Note: This feature requires yq, which the action installs automatically if needed.
steps:
- name: Clone repository
uses: actions/checkout@v6
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version-file: pubspec.yaml
- run: flutter --version