Flutter CLI Cheat Sheet
source link: https://dev.to/assisfery/flutter-cli-cheat-sheet-1l1
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
This is a cheat sheet for the most useful commands you will need when developing a flutter app.
To see all the commands, call the help as below.flutter --help
Orflutter -h
Start Project Commands
New project
To create a new project just run the below command, don't forget to replace myproject to your project name lol.flutter create myproject
You can specify your company website and it will be used to create your application id.flutter create --org=com.mycompany myproject
May you want to create a project with distinct folder name from project name.flutter create --org=com.mycompany --project-name=myproject myfolder
Development Commands
To run your project, just go to root directory of your project and run the code below, and next choose the device where you want to run your project.flutter run
Install Package
To install a package use the code below.flutter pub add package_name
Update Packages
To update all the packages in your project, run the command below.flutter pub upgrade
Build
To build your app and start using it in production, use that command.flutter build target_platform_name --release
SDK Commands
Devices
List all the devices available in you computer.flutter devices
Channel
Flutter has tree release channel, you can list them using the command below.flutter channel
To switch the channel you want to use for your development, run the command below.flutter channel channel_name
Bug Report
Upgrade
Upgrade the Flutter SDK.flutter upgrade
Doctor
Show information and status of installed tools.
flutter doctor
Enter fullscreen mode
Exit fullscreen mode
References
https://docs.flutter.dev/reference/flutter-cli
Photo by Rodion Kutsaev on Unsplash
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK