Add support for Flutter snap on Linux #2613
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At Canonical we've developed a convenient way to install and use Flutter on Linux.
By simply running:
You'll have all the dependancies you need to begin developing Flutter applications. From here you just type:
flutter create,flutter run, etc. as normal to perform flutter tasks.The Flutter repo is stored under
$HOME/snap/flutter/common/flutter/, but the actual flutter script (executed by the call toflutter) is installed to/snap/flutter/current/flutter.sh. This allows users to switch flutter versions as needed via the home directory, while taking advantage of the dev environment provided by the snap.To get this working in VS Code, we need the extension to detect whether the flutter snap is installed, and if so, be aware of the separate repo and script paths for execution.
Furthermore, because snaps are installed at root-level, the Flutter repo is only populated on first user run of the snap. We therefore must also check if the repo exists on startup, and initialise it if not.