text
stringlengths
1
372
assists & quick fixes
assists are code changes related to a certain code identifier.
a number of these are available when the cursor is placed on a
flutter widget identifier, as indicated by the yellow lightbulb icon.
the assist can be invoked by clicking the lightbulb, or by using the
keyboard shortcut (alt+enter on linux and windows,
Option+Return on macOS), as illustrated here:
quick fixes are similar, only they are shown with a piece of code has an error
and they can assist in correcting it. they are indicated with a red lightbulb.
<topic_end>
<topic_start>
wrap with new widget assist
this can be used when you have a widget that you want to wrap in a surrounding
widget, for example if you want to wrap a widget in a row or column.
<topic_end>
<topic_start>
wrap widget list with new widget assist
similar to the assist above, but for wrapping an existing list of
widgets rather than an individual widget.
<topic_end>
<topic_start>
convert child to children assist
changes a child argument to a children argument,
and wraps the argument value in a list.
<topic_end>
<topic_start>
live templates
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 reload
on 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