On the first run, LXD may not be able to connect to its socket:

An error occurred when trying to communicate with the 'LXD'
provider: cannot connect to the LXD socket
('/var/snap/lxd/common/lxd/unix.socket').

This means you need to add your user name to the LXD
(lxd) group, so log out of your session and then log back in:

sudo usermod

a

G lxd <your username>

Overview of snapcraft

The snapcraft tool builds snaps based on the instructions
listed in a snapcraft.yaml file.
To get a basic understanding of snapcraft and its
core concepts, take a look at the Snap documentation
and the Introduction to snapcraft.
Additional links and information are listed at the
bottom of this page.

Flutter snapcraft.yaml example