flutter create
- Flutter course
- Beginner
- Lesson 6/99
- 4 min
Learn how to scaffold a new project with flutter create.
The flutter create command
The flutter create command generates the entire skeleton of a new Flutter project in one step. The command produces the lib/, android/, ios/, web/ folders, the pubspec.yaml file and a working sample app. Instead of creating files from scratch, you start coding right away.
$ flutter create ilk_uygulama
Creating project ilk_uygulama...
Running "flutter pub get"...
All done!
$ cd ilk_uygulama
$ flutter runpubspec.yaml
pubspec.yaml is the Flutter project's configuration file. You list the project name, version, Dart SDK constraint and dependencies here. The flutter pub get command downloads the dependencies declared in this file and adds them to the project.
name: ilk_uygulama
description: My first Flutter app
environment:
sdk: '>=3.0.0 <4.0.0'
dependencies:
flutter:
sdk: flutterPractice Print project folders
In main, print three folder names with print: lib/, android/, ios/.
Starter code
void main() {
// üç klasör adını print ile yazdır:
// lib/
// android/
// ios/
}Sample solution
void main() {
print('lib/');
print('android/');
print('ios/');
}Expected output
lib/ android/ ios/
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 What does the flutter create command produce?
- Only the pubspec.yaml file
- Only the APK build output
- Only the lib/ folder
- A working project skeleton and a sample app Correct answer
Explanation: flutter create produces the entire project skeleton along with a working sample app; not just a single file or folder.
2 Create a new project
flutter ____ ilk_uygulama
flutter create ilk_uygulama
Explanation: The flutter create subcommand generates a new project skeleton.
3 create and pubspec
| Term | Meaning |
|---|---|
flutter create |
Generates the project skeleton |
pubspec.yaml |
Declares dependencies |
flutter pub get |
Downloads dependencies |
lib/ |
Folder holding Dart source code |