how do i create a flutter project without the android and iOS build folders, only for web build only?
Asked Answered
G

4

7

I would like to create a flutter project but I don't want to include the android and iOS version build folders and functionalities.

How can I make this to create with the web build only?

Gragg answered 10/8, 2021 at 13:58 Comment(0)
S
12

flutter create --platforms=web <name>

See flutter --help create for full documentation of the platforms flag, as well as all the other creation options.

Sweated answered 11/8, 2021 at 14:51 Comment(1)
Thanks, this is very useful. It hasn't been mentioned on the CLI reference.Symmetrical
P
6

If you only need Web, Linux and Windows :

flutter create --platforms=web,linux,windows


If you only need Web :

flutter create --platforms=web

Package answered 11/1, 2023 at 23:21 Comment(0)
S
0

There is no command to create a project for web only. The flutter create command only takes one argument and that is the project directory/name. flutter create <DIRECTORY>, like shown on the Flutter CLI reference.

If you don't need an iOS/Android app you can delete the ios and androidfolders.

And to build your app for web you can run flutter build web.

Symmetrical answered 10/8, 2021 at 14:14 Comment(1)
You should run flutter --help create; it has many flags.Sweated
O
-2

If you want to create your project only for Android & iOS, use this command:

--platforms=android,ios

Example:

flutter create [PROJECT_NAME] --platforms=android,ios
Obannon answered 16/9, 2023 at 9:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.