Notes: 03. Create a Flutter Desktop App
You will need a Macintosh or Windows computer. You will need to install Flutter, and the latest version of Android Studio. We recommend watching our Your First Flutter App for information on how to create a flutter app.
Creating a project from the IDE or command line
You can create a project from either Android Studio or the command line. You can also use this method when you have an existing project. If you type:
Create project form Command line
flutter create --platforms=windows,macos .
inside of an existing project, this command creates new sub directories for Windows and Mac. If you want to only develop desktop apps, then you will need to delete the iOS and Android directories.
Command Line
To create both platforms at once without iOS and Android, you can create the project from the command line.
flutter create --platforms=windows,macos todo
This will create the whole project structure with just the windows and macos folders.
Android Studio
Open up Android Studio. Now choose New -> New flutter project. Make sure your Flutter SDK path is correct. Click next. Enter in the name Todo for the Project. Select a project location and give a better description of the project. Keep the type as an application and enter your organization. We’ll use com.kodeco. Un-check Android and iOS if this is just a desktop application. Click Finish.
Notice that in the project tab you have the usual Flutter lib directory along with the windows and macos directories. Opening up the macos folder, you will see a Flutter, Pods, and Runner folders. The other two folders are the XCode project files. There is also a Podfile, which is used by CocoaPods, an application level dependency manager for the Mac and iOS.
The windows folder also has flutter and runner folders. The runner folder has C++ files to help run Flutter on Windows. We will be using this on a Windows machine.
Congratulations, you now know how to create a desktop project for developing Macintosh and Windows Flutter apps.