Disable Desktop Support Flutter - flutter

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.

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.

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

Related

Build option for windows is not showing in android studio

I am in the latest stable release for flutter desktop and have installed Visual Studio 2022 but still the option for "Windows" is not showing.
Do i still need to run the below command in stable release?
flutter config --enable-<windows>-desktop
You need to try its working fine
flutter config --enable-macos-desktop
flutter config --enable-linux-desktop
flutter config --enable-windows-desktop
flutter config --enable-windows-uwp-desktop
Sometimes it needs to press the previous and Then the next button.

How can I remove chrome opening by default from Flutter?

How can I remove chrome opening by default from Flutter? Chrome is opening by default and I have Android Emulator installed
If you want to disable "Chrome" from flutter use this flutter config --no-enable-web and restart the IDE.
To check the available device flutter devices
To enable it back flutter config --enable-web
If you use a command line just use -d key like: $flutter run -d $device_id
to determine the device id run $flutter devices command.
if you use an IDE just select a target device in the IDE's UI.

How do I remove devices for running Flutter?

I tried creating a new flutter project in Visual Studio Code, but for whatever reason it now has a default device of Google Chrome every time I try to run it. I don't want to run Flutter in web environments whatsoever: is there any way I can disable this?
Run the following command to disable web completely.
flutter config --no-enable-web
Then restart your editor if necessary.
First, run your emulator from the AVD manager or connect your physical device while it's on debugging mode, if it's an android device, then choose the device you want to run from the flutter device selection option

Stuck at Syncing files to device Chrome when trying to run a web project

I'm stuck at Syncing files to device Chrome when running the project, the same result from vscode terminal and command prompt, I only get a white screen on a google window and it doesn't seem to be in progress anymore, the steps that I made to create the project are :
flutter channel master
flutter upgrade
flutter config --enable-web
flutter create webapp
cd webapp
flutter run
I tried to check the console with F12 on the browser but it is empty.
I can run the project only in the release mode with flutter run --release, but it so exhausting to test on this mode seen that the hot reload takes so much time.
It is recommended to use beta channel for web support in flutter.
flutter channel beta

how to create flutter project only for only android and IOS even if web support is enabled?

I wanted to create flutter project targeted to only android and IOS. But my web support is enabled in flutter.
I don't want to go back to stable channel to do that. Anyone can help me out in doing this in beta channel itself
You can disable web support in flutter config. use flutter config --no-enable-web to disable and flutter config --enable-web to enable. There are several other options as well which you can explore by running flutter config.
Disable platforms in all projects
flutter config --no-enable-[platform-name], eg: flutter config --no-enable-web.
Disable platforms in a specific project
New project: flutter create --platform ios,android
Existing project: Edit the <project-root>/.metadata file, delete unwanted platforms under migration -> platforms. Only leave root and platforms you need. I can't find this documented anywhere so the method can stop working anytime, as of Feb. 2023 it worked for me.