Flutter plugin¶
The Flutter plugin simplifies the building of applications that employ the Flutter UI toolkit.
Keywords¶
This plugin provides the following unique keys for core22 and newer snaps.
flutter-channel¶
Type: stable
, master
, or beta
Default: stable
The flutter channel to use for the build.
flutter-target¶
Type: string
Default: lib/main.dart
The path to the app’s entrypoint .dart
file.
Dependencies¶
For core22 and newer snaps, this plugin installs:
clang
curl
git
cmake
ninja-build
unzip
.
How it works¶
During the build step, the plugin performs the following actions:
Clone Flutter’s GitHub repository, using the channel declared by the
flutter-channel
key. If a channel isn’t specified, thestable
channel is cloned.Populate Flutter’s cache of binary artifacts with
flutter precache
.Download any dependencies listed in the Flutter project’s
pubspec.yaml
withflutter pub get
.Build the app with
flutter build
.Copy the resulting artifacts to the part’s install directory.
Example¶
See Craft a Flutter app for an example of a snap built with the Flutter plugin.