The flutter plugin

This flutter plugin is useful for building Flutter based parts. This plugin uses the common plugin keywords as well as those for sources. For more information, see Snapcraft parts metadata.

Plugin-specific features and syntax are dependent on which base is being used, as outlined below:

See Flutter applications for a simple example, or search GitHub for projects using the plugin.

Further examples can also be found in the Ubuntu Flutter Community on GitHub.

ⓘ This is a snapcraft plugin. See Snapcraft plugins and Supported plugins for further details on how plugins are used.

base: core24 | core22

  • flutter-channel (enum: [stable, master, beta], default: stable)
    The default flutter channel to use for the build.
  • flutter-target (string, default: lib/main.dart)
    The flutter target to build.

Requires Snapcraft version 8.0+ for core24.

Requires Snapcraft version 7.3+ for core22.

base: core18

This plugin uses the following plugin-specific keywords:
  • flutter-revision (string)
    Defines which Flutter revision to use for the build. This must be a valid revision from the Flutter repository.
  • flutter-target (string, default: lib/main.dart)
    The main entry-point file of the application.

Requires Snapcraft version 4.1.1+.

Hello! Thank you for ability to build the Flutter application using Snap. But there is an ass big issue and the one still not resolved. It causes unable to build an application.

I tried to build snap archive of test project, but that was imposible

roman@roman-vm:~/Others/super-cool-app$ snapcraft --version
snapcraft 7.2.9

Sorry for the delay responding to you. We will try to update/test our Flutter documentation as we move away from core18.

For what it’s worth, I was just able to successfully build the same test project by changing flutter-master to flutter-stable:

 apps:
   super-cool-app:
     command: super_cool_app
-    extensions: [flutter-master]
+    extensions: [flutter-stable]

The above worked with snapcraft 7.3.1 (rev 8931), but I’d like to revisit this and update our Flutter example completely.

Might be worth mentioning there is a GitHub repo specifically for Ubuntu flutter stuff, https://github.com/ubuntu-flutter-community/

1 Like