The problem was that I installed Visual Studio Code from the Flatpak store. Downloading the .deb file from the VSCode website and installing it and manually downloading the zip file of the Flutter SDK fixed the problem.