- Introduction
- Basics
- App1 : Elon Musk’s Resume
- App2 : 5K Quotes
- App3 : Calculator
- App4_v1 : Flags Quiz
- Running Apps On Different Devices
- Debbuging
- App5 : Yacht Charter
- App6_v1 : My Books
- Creating responsive and adaptive apps
- App6_v2: My Books
- App7 : Short Vacation
- App8 : Movie Time
- App9 : Schedule Planner
- Shared Preferences
- App10 : Local Weather
- App11 : Discover Tunisia
First application
Now, we will create our first flutter app and test everything.
-
Run flutter doctor to check again that all dependencies are completed.
-
Invoke View > Command Palette. (Ctrl + Shift + P)
-
Type “flutter”, and select the Flutter: New Application Project.
-
Create or select the parent directory for the new project folder.
-
Enter a project name, such as first_app, and press Enter.
-
Wait for project creation to complete and the main.dart file to appear.
-
Run flutter emulators to check the available emulators
-
Invoke Run > Run Without Debugging(Ctrl + F5).
-
Wait for the app to launch
-
Change the primarySwatch from Colors.blue to Colors.green
-
Save your changes: invoke Save All (Ctrl + S), or click Hot Reload to see the updated color in the running app almost immediately.
What is the difference between hot reload, hot restart, and full restart?
Hot reload loads code changes into the VM and re-builds the widget tree, preserving the app
state; it doesn’t rerun main() or initState(). (F5 in VSCode)
Hot restart loads code changes into the VM, and restarts the Flutter app, losing the app state.
(⇧ F5 in VSCode)
Full restart restarts the iOS, Android, or web app. This takes longer because it also
recompiles the Java / Kotlin / ObjC / Swift code. On the web, it also restarts the Dart Development Compiler.
There is no specific keyboard shortcut for this; you need to stop and start the run configuration.
Flutter web currently supports hot restart but not hot reload.