Place for settings files

Hi. I create snap package of my flutter app.

I have problem, because I don’t permissions in my snap for saving file.
[ERROR:flutter/lib/ui/ui_dart_state.cc(171)] Unhandled Exception: FileSystemException: Cannot open file, path = '/home/michal/Documents/settings.hive' (OS Error: Permission denied, errno = 13)

I can give access for home directory per snap, but I would like hide this file. Is possible in snapcraft maping directory and keeping it inside? (There is no important data there, but why keep it in the documents?)

Library from flutter find the local path: /home/michal/Documents/settings.hive

The normal place for Linux apps to store settings is $XDG_CONFIG_HOME (or, if that isn’t set, $HOME/.config). [ref: https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html]

You should find your snap has $HOME overridden to something like /home/michal/snap/yoursnap/1 and you should create and use a $HOME/.config directory for your settings file.