-
To use Flutter DevTools from VS Code, install the Flutter extension. This also automatically installs the Dart extension. With these extensions, you can debug your Flutter app.
-
Open the Command Palette.
Go to View > Command Palette or press + Shift + P.
-
Type
flutter
. -
Select Flutter: New Project.
-
When prompted for Which Flutter Project, select Application.
-
Create or select the parent directory for the new project folder.
-
When prompted for a Project Name, enter
test_drive
. -
Press Enter.
-
Wait for project creation to complete.
-
Open the
lib
directory, then themain.dart
.To learn what each code block does, check out the comments in that Dart file.
The previous commands create a Flutter project directory called test_drive
that
contains a simple demo app that uses Material Components.
Run your example application on your desktop platform, in the Chrome web browser, in an iOS simulator, or Android emulator.
:::note Though you can deploy your app to the web, the web target doesn't support hot reload at this time. :::
-
Open the Command Palette.
Go to View > Command Palette or press + Shift + P.
-
Type
flutter
. -
Select Flutter: Select Device.
If no devices are running, this command prompts you to enable a device.
-
Select a target device from Select Device prompt.
-
After you select a target, start the app. Go to Run > Start Debugging or press F5.
-
Wait for the app to launch.
You can watch the launch progress in the Debug Console view.
{% capture save_changes -%} : invoke Save All, or click Hot Reload {% render docs/install/test-drive/hot-reload-icon.md %}. {% endcapture %}
{% include docs/install/test-drive/try-hot-reload.md save_changes=save_changes ide="VS Code" %}
<script> document.addEventListener("DOMContentLoaded", function() { const specialKey = navigator.userAgent.includes('Mac')? 'Command' : 'Control'; document.querySelectorAll('.special-key').forEach((element)=>element.textContent=specialKey); }); </script>