text
stringlengths
1
474
Live templates can be used to speed up entering typical code structures.
They are invoked by typing their prefix, and then selecting it in the code
completion window:The Flutter plugin includes the following templates:You can also define custom templates in Settings > Editor > Live Templates.<topic_end>
<topic_start>
Keyboard shortcuts
Hot reloadOn Linux (keymap Default for XWin) and Windows the keyboard shortcuts
are Control+Alt+; and Control+Backslash.On macOS (keymap Mac OS X 10.5+ copy) the keyboard shortcuts are
Command+Option and Command+Backslash.Keyboard mappings can be changed in the IDE Preferences/Settings: Select
Keymap, then enter flutter into the search box in the upper right corner.
Right click the binding you want to change and Add Keyboard Shortcut.<topic_end>
<topic_start>
Hot reload vs. hot restart
Hot reload works by injecting updated source code files into the running
Dart VM (Virtual Machine). This includes not only adding new classes,
but also adding methods and fields to existing classes,
and changing existing functions.
A few types of code changes cannot be hot reloaded though:For these changes you can fully restart your application,
without having to end your debugging session. To perform a hot restart,
don’t click the Stop button, simply re-click the Run button (if in a run
session) or Debug button (if in a debug session), or shift-click the ‘hot
reload’ button.<topic_end>
<topic_start>
Editing Android code in Android Studio with full IDE support
Opening the root directory of a Flutter project doesn’t expose all the Android
files to the IDE. Flutter apps contain a subdirectory named android. If you
open this subdirectory as its own separate project in Android Studio, the IDE
will be able to fully support editing and refactoring all Android files (like
Gradle scripts).If you already have the entire project opened as a Flutter app in Android
Studio, there are two equivalent ways to open the Android files on their own
for editing in the IDE. Before trying this, make sure that you’re on the latest
version of Android Studio and the Flutter plugins.For both options, Android Studio gives you the option to use separate windows or
to replace the existing window with the new project when opening a second
project. Either option is fine.If you don’t already have the Flutter project opened in Android studio,
you can open the Android files as their own project from the start:If you haven’t run your Flutter app yet, you might see Android Studio report a
build error when you open the android project. Run flutter pub get in
the app’s root directory and rebuild the project by selecting Build > Make
to fix it.<topic_end>
<topic_start>
Editing Android code in IntelliJ IDEA
To enable editing of Android code in IntelliJ IDEA, you need to configure the
location of the Android SDK:<topic_end>
<topic_start>
Tips and tricks
<topic_end>
<topic_start>
Troubleshooting
<topic_end>
<topic_start>
Known issues and feedback
Important known issues that might impact your experience are documented
in the Flutter plugin README file.All known bugs are tracked in the issue trackers:We welcome feedback, both on bugs/issues and feature requests.
Prior to filing new issues:When filing new issues, include the output of flutter doctor.
<topic_end>
<topic_start>Visual Studio Code
<topic_end>
<topic_start>
Installation and setup
Follow the Set up an editor instructions to
install the Dart and Flutter extensions
(also called plugins).<topic_end>
<topic_start>
Updating the extension
Updates to the extensions are shipped on a regular basis.
By default, VS Code automatically updates extensions when
updates are available.To install updates yourself:<topic_end>
<topic_start>
Creating projects
There are a couple ways to create a new project.<topic_end>
<topic_start>
Creating a new project
To create a new Flutter project from the Flutter
starter app template:Go to View >
Command Palette….You can also press Ctrl / Cmd +
Shift + P.<topic_end>
<topic_start>
Opening a project from existing source code
To open an existing Flutter project:Go to File > Open.You can also press Ctrl / Cmd + O<topic_end>
<topic_start>
Editing code and viewing issues
The Flutter extension performs code analysis.
The code analysis can:Navigate to type declarationsFind type usages.View all current source code problems.<topic_end>
<topic_start>
Running and debugging
info Note
You can debug your app in a couple of ways.The instructions below describe features available in VS Code.
For information on using launching DevTools, see
Running DevTools from VS Code in the DevTools docs.Start debugging by clicking Run > Start Debugging
from the main IDE window, or press F5.<topic_end>
<topic_start>
Selecting a target device
When a Flutter project is open in VS Code,
you should see a set of Flutter specific entries in the status bar,
including a Flutter SDK version and a
device name (or the message No Devices):
info NoteThe Flutter extension automatically selects the last device connected.
However, if you have multiple devices/simulators connected, click
device in the status bar to see a pick-list
at the top of the screen. Select the device you want to use for
running or debugging.Are you developing for macOS or iOS remotely using
Visual Studio Code Remote? If so, you might need to manually