Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Flutter snap on Linux #2613

Merged

Conversation

MarcusTomlinson
Copy link
Contributor

At Canonical we've developed a convenient way to install and use Flutter on Linux.

By simply running:

snap install flutter --classic

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 to flutter) 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.

@DanTup DanTup changed the base branch from master to linux-snap-support July 7, 2020 15:58
@DanTup
Copy link
Member

DanTup commented Jul 7, 2020

@MarcusTomlinson looks great, thanks! I'm going to merge into a branch for now so I can try it out when I have a VM set up and also to try and include a test for it in GitHub actions. I may ping you if I get stuck of have questions. Thanks!

@DanTup DanTup added in flutter Relates to running Flutter apps is enhancement on linux labels Jul 7, 2020
@DanTup DanTup added this to the v3.13.0 milestone Jul 7, 2020
@DanTup DanTup merged commit 5682660 into Dart-Code:linux-snap-support Jul 7, 2020
DanTup added a commit that referenced this pull request Jul 7, 2020
* Support overriding the base Flutter script without each individual command

* Add support for Flutter snap on Linux

* Don't set flutterScript if snap not initialized

* Move snap initialization to findFlutterSnapSdkRoot

Co-authored-by: Danny Tuppeny <danny@tuppeny.com>
DanTup added a commit that referenced this pull request Jul 8, 2020
* Support overriding the base Flutter script without each individual command

* Add support for Flutter snap on Linux

* Don't set flutterScript if snap not initialized

* Move snap initialization to findFlutterSnapSdkRoot

Co-authored-by: Danny Tuppeny <danny@tuppeny.com>
@DanTup DanTup modified the milestones: v3.13.0, v3.12.2 Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in flutter Relates to running Flutter apps is enhancement on linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants