6

I created a Flutter project within Android Studio, and then later found out that Flutter supports desktop. After searching the web, I did things like switching to "dev", adding config for desktop, etc. But when I tried to ran it, I got "No Windows desktop project configured", even though I enabled the configuration.

The documentation page had

To add desktop support to an existing Flutter project, run the following command in a terminal from the root project directory:

flutter create .

This adds the necessary desktop files and directories to your existing Flutter project.

But what is the meaning of .? How come that . means "adding desktop support"?

Damn Vegetables
  • 11,484
  • 13
  • 80
  • 135

4 Answers4

18

The command to add desktop support are those one:

 flutter config --enable-windows-desktop
 flutter config --enable-macos-desktop
 flutter config --enable-linux-desktop

Once you used them, you change your flutter config.

Then, the usage of flutter create . simply mean "Create a new flutter project in my current folder".
If you're already in a Flutter project, it will just "recreate" your project by adding the new support for Desktop since you specify in your flutter config.

BLKKKBVSIK
  • 3,128
  • 2
  • 13
  • 33
5
  1. flutter config --enable-[windows,linux,macos]-desktop
  2. flutter create .

if there is some error with second command, remove - sign from parent folder name, and run this command:

flutter create --org com.example.myapp .
Khamidjon Khamidov
  • 6,783
  • 6
  • 31
  • 62
2

Run this command it works fine for me.

run

flutter config --enable-windows-desktop

then run

flutter create .

if flutter create . generate error, probably there is - in your root project directory.

for example it will generate error if your project is like below

Alewa-Stock

to work it fine rename your project directory like below

alewa_stock

then run the following command

flutter create --platforms=windows --org=com.alewa.store .

*

NB: Please change the name according to your preference.

2
flutter create --platforms=windows,macos,linux .

you can use this line instead