Running Flutter
There are a few ways you can interact with the Flutter SDK setup. These will depend primarily on preference.
Proxy Commandsβ
You are able to proxy any flutter
or dart
commands to the configured version by adding fvm
in front of it.
Flutterβ
# Use
> fvm flutter {command}
# Instead of
> flutter {command}
Dartβ
# Use
> fvm dart {command}
# Instead of
> dart {command}
tip
Configure the following alias for a shorthand version of the command
# aliases
f="fvm flutter"
d="fvm dart"
# Now you can use
f run
Benefitsβ
- Find relative project configurations.
- Monorepo compatibility.
- Fallback to
global
configured version orPATH
configured.
Routingβ
When proxying commands, FVM
will look for an sdk in the following order.
- Project
- Ancestor directory
- Global (Set through FVM)
- Environment (Flutter version configured on
PATH
)
Call SDK Directlyβ
Versions installed by FVM are standard Flutter SDK installs. That means you are able to call them directly without proxying through FVM.
Using the symlink will dynamically call the configured version for the project.
# flutter run
.fvm/flutter_sdk/bin/flutter run
tip
Configure the following alias to call the relative project version, without the need to proxy.
fv=".fvm/flutter_sdk/bin/flutter"
Spawn Commandβ
Spawns a command on any installed Flutter SDK.
fvm spawn {version}
Example
The following will run flutter analyze
on the master
channel
fvm spawn master analyze