Closed BriceCroix closed 2 weeks ago
Hi! Thanks for opening your first issue here! :smile:
Looks reasonable and feel free to PR (since this does not look very hard)! Alternatively I may work on it later.
We may need to determine how to know whether to use fvm or normal flutter binary. One way may be, try to see whether fvm
exists (maybe execute fvm --help
and see return code is zero or nonzero), and if exists use it, otherwise do not use it.
Btw, we may also handle fvm dart
(instead of dart
) as well.
I guess code change may be near https://github.com/fzyzcjy/flutter_rust_bridge/blob/17fdf93e375d30969ddb31d88b26de6f7f5a6d65/frb_codegen/src/library/utils/dart_repository/dart_toolchain.rs#L36
Thanks for looking into this ! I think the best way to determine if flutter must be used from global install or from fvm
is to look for a .fvmrc
file in the project directory.
Alternatively before its version 3.0, fvm
used to get its configuration from the .fvm/fvm_config.json
project file. One may also look for this file.
I agree that supporting pure fvm dart
would also be great, I will look into how fvm
configures itself in that case.
I think the best way to determine if flutter must be used from global install or from fvm is to look for a .fvmrc file in the project directory.
Looks reasonable! Sometimes .fvm
directory is from parent folder, so we may need to recursively check as well.
Alternatively before its version 3.0
Looks like we only need to support latest fvm and no worries about old versions
@BriceCroix, if you can't wait for the fix, why don't you create an alias so that flutter
calls fvm flutter
, as described in https://fvm.app/documentation/guides/running-flutter#call-sdk-directly ?
Alternatively I can recommend using nix flake
. I use it in my project.
@BriceCroix, if you can't wait for the fix, why don't you create an alias so that
flutter
callsfvm flutter
, as described in https://fvm.app/documentation/guides/running-flutter#call-sdk-directly ?Alternatively I can recommend using
nix flake
. I use it in my project.
Yes I ended up adding fvm's internal directories to my path so that flutter
is found, this is a nice workaround but I still think calling the version of flutter required by a specific project through the .fvmrc
would be a great feature.
I started to look into but but hadn't had much time to come up with something
Yes I ended up adding fvm's internal directories to my path so that
flutter
is found, this is a nice workaround but I still think calling the version of flutter required by a specific project through the.fvmrc
would be a great feature.
Ah, great :) Hmm, I understood that this is solved as well, that
sudo echo 'fvm flutter ${@:1}' > "/usr/local/bin/flutter" && sudo chmod +x /usr/local/bin/flutter
is binding the command flutter
to fvm flutter
- and thus fvm takes care to take the flutter version specified in the project.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.
Hi, first of all thank you all for this awesome project.
I would like to know if it is possible to use
flutter_rust_bridge_codegen
utility withfvm flutter
. I do not have the regularflutter
command on my computer and do not wish to install it. If you do not know FVM it is an elegant solution to manage the flutter version used by each specific project, here is its main website.As of now, the executable exits with the following error message :
I could not find any information about
fvm
in the documentation of this repository but perhaps I did not look at the right place.If this is not possible right now, I think it would be great to add something like a
--use-fvm
or--flutter-path /path/to/fvm/flutter
option to the codegen call.Thanks a lot for your time !