Judy
Judy

Reputation: 141

How does the command "flutter create" work?

I want to know how do all the files are generated when I execute flutter create <app_name> command.

I've looked through flutter/flutter repository and flutter/engine repository but couldn't find the answer.
I would like to customize the codes of lib/main.dart file when I create a new app, so I want to know where are the auto-generated files come from. Thanks for your help in advance.

Upvotes: 1

Views: 316

Answers (1)

julemand101
julemand101

Reputation: 31219

I am not a Flutter developer so I am not that strong into how the project are organized. But by searching around I found the following package which seem to be the base of the Flutter tool:

https://github.com/flutter/flutter/tree/master/packages/flutter_tools

You can e.g. find the examples for flutter create here: https://github.com/flutter/flutter/tree/master/packages/flutter_tools/templates/app

The create command itself is defined here: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/commands/create.dart

And the Flutter tool are mainly running this file which then points out to all sub commands: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/executable.dart

Upvotes: 3

Related Questions