29

So, I wanted to try desktop development in Flutter. I went through all steps and successfully enabled desktop support for Flutter using flutter config --enable-linux-desktop in master channel.

Now everytime I create a new project in Flutter, it automatically builds necessary files for Linux Desktop.

I tried running flutter config --disable-linux-desktop, but there is no command like that. How do I disable desktop support?

PS : I don't want to switch to stable channel since I also want to make my apps for Web.

Detained Developer
  • 1,134
  • 2
  • 13
  • 33

2 Answers2

46

You can disable enabled flags with adding no- prefix to the enable command. For disabling linux desktop flag you can simply run flutter config --no-enable-linux-desktop.

Amir_P
  • 8,322
  • 5
  • 43
  • 92
  • 3
    That works, thank you! I never imagined a command like this, starting with `no`, instead of `disable`. Also, didn't find anything in `docs` too. Thanks again! – Detained Developer Aug 22 '20 at 08:44
  • @DetainedDeveloper Agreed, `disable` is the first thing I tried as well.. if the command was called `disable` that'd save a lot of people from searching on the internet I suppose. – WSBT Jan 05 '22 at 20:38
  • 1
    Worked but then I had to remove the linux folder manually. – Rajesh Feb 15 '22 at 10:56
28

Here are the terminal commands to disable the desktop support for your flutter projects.

macOS:

flutter config --no-enable-macos-desktop

Windows:

flutter config --no-enable-windows-desktop

Linux:

flutter config --no-enable-linux-desktop

New Project with flutter will have these platforms disabled like this

New Flutter Project with Android Studio

Shahid Ghafoor
  • 829
  • 8
  • 17