Table of Contents
Once flutter sdk and your terminal is up and running, To Create a new flutter project from the flutter starter app template follow the below steps
|CD Project Folder|
Syntax : flutter create <app name>
|flutter create command|
Wait for a couple of seconds and let flutter create the required files and folders in your project location.
|Flutter App Created|
Your flutter project is ready ! Edit your flutter code using your favorite code editor.
|CD Flutter App Directory|
|flutter run command - no device|
If you get an output : No supported devices connected.
|flutter devices command - no device|
To run the flutter app or project you must have either a physical device or emulator connected.
Now, let us understand how to run the emulator device using terminal.
Run command : flutter emulators - to get the list of emulators
|flutter emulators command|
Note your emulator id - In this demo, our emulator id is “Pixel API 28 “
Run command : flutter emulators –launch <emulator id>
|flutter emulator launch command|
Once the Emulator device is up and running,
Once again, Run command : flutter devices
|flutter devices command|
It should show you number of connected devices
Once you have one or more connected devices, we can now run the flutter app or project on the connected devices.
Run command : flutter run - to run your project
|flutter run command|
Note : if you have more than one device use command - flutter run -d <device id>
Your flutter app is now running successfully on your connected devices.
|Flutter Demo App|
Flutter Hot Reload : Type r in the terminal windows once you have edited your code to update your app UI instantly.
|Flutter Hot Reload|
Flutter Hot Restart : Type R (shift + r) in the terminal window to restart your app.
|Flutter Hot Restart|