Working with Flutter, as a best practice I use fvm to manage my Flutter versions and be able to switch from one to another according to the project.
As I wanted to contribute to Flutter, I followed the contributing documentation on how to setup my local forked Flutter sdk until I saw this sentence: "Add this repository's ++code>bin++/code> directory to your path"
I got to thinking: I use fvm to be able to switch from one Flutter version to another in an instant and I should not be juggling with both the versions handled by fvm AND the bin my path is pointing to? I want to keep using fvm to switch to my local Flutter repository and easily test and debug any contributions I would make. I started to look for a way to do just this and here is what I've put together:
you have installed fvm and use it to manage your flutter versions
1. Following Flutter's Setting up the Framework development environment documentation, when you reach step 4. which consists in cloning your own fork of the flutter repository, do so from within your ++code>~/fvm/versions++/code> folder:
++pre>++code>$ cd ~/fvm/versions
$ git clone email@example.com:<github_username>/flutter.git
2. Add a custom version to fvm (https://fvm.app/docs/advanced/custom_version)
a. Rename the cloned repository into a name starting with "++code>custom_++/code>"
++pre>++code>$ mv flutter custom_local++/code>++/pre>
b. Check that your version is listed among all your fvm installed versions:
++pre>++code>$ fvm list
Cache Directory: ~/fvm/versions
custom_local (active) # <---- ?
3. Configure your project to use your custom flutter version:
++pre>++code>$ fvm use custom_local
This should set the version to your local fvm configuration:
4. Run any flutter command using ++code>fvm flutter++/code> (ex: ++code>fvm flutter run++/code>) as you'd do with any other versions. Your app is now running based on your local forked version of flutter, and any changes you make within the ++code>custom_local++/code> repository will be testable directly.