text
stringlengths 1
474
|
|---|
it is better to specify these now. They cannot be changed once the app
|
is released. Your organization name should be unique.<topic_end>
|
<topic_start>
|
Opening a project from existing source code
|
To open an existing Flutter project:Click Open.error Important
|
Do not use the New > Project from existing sources
|
option for Flutter projects.<topic_end>
|
<topic_start>
|
Editing code and viewing issues
|
The Flutter plugin performs code analysis that enables the following:<topic_end>
|
<topic_start>
|
Running and debugging
|
info Note
|
You can debug your app in a few ways.The instructions below describe features available in Android
|
Studio and IntelliJ. For information on launching DevTools,
|
see Running DevTools from Android Studio in the
|
DevTools docs.Running and debugging are controlled from the main toolbar:<topic_end>
|
<topic_start>
|
Selecting a target
|
When a Flutter project is open in the IDE, you should see a set of
|
Flutter-specific buttons on the right-hand side of the toolbar.info Note
|
If the Run and Debug buttons are disabled, and no targets are listed,
|
Flutter has not been able to discover any connected iOS or
|
Android devices or simulators.
|
You need to connect a device, or start a simulator, to proceed.<topic_end>
|
<topic_start>
|
Run app without breakpoints
|
<topic_end>
|
<topic_start>
|
Run app with breakpoints
|
<topic_end>
|
<topic_start>
|
Fast edit and refresh development cycle
|
Flutter offers a best-in-class developer cycle enabling you to see the effect
|
of your changes almost instantly with the Stateful Hot Reload feature.
|
To learn more, check out Hot reload.<topic_end>
|
<topic_start>
|
Show performance data
|
info Note
|
To examine performance issues in Flutter, see the
|
Timeline view.To view the performance data, including the widget rebuild
|
information, start the app in Debug mode, and then open
|
the Performance tool window using
|
View > Tool Windows > Flutter Performance.To see the stats about which widgets are being rebuilt, and how often,
|
click Show widget rebuild information in the Performance pane.
|
The exact count of the rebuilds for this frame displays in the second
|
column from the right. For a high number of rebuilds, a yellow spinning
|
circle displays. The column to the far right shows how many times a
|
widget was rebuilt since entering the current screen.
|
For widgets that aren’t rebuilt, a solid grey circle displays.
|
Otherwise, a grey spinning circle displays.The app shown in this screenshot has been designed to deliver
|
poor performance, and the rebuild profiler gives you a clue
|
about what is happening in the frame that might cause poor
|
performance. The widget rebuild profiler is not a diagnostic
|
tool, by itself, about poor performance.The purpose of this feature is to make you aware when widgets are
|
rebuilding—you might not realize that this is happening when just
|
looking at the code. If widgets are rebuilding that you didn’t expect,
|
it’s probably a sign that you should refactor your code by splitting
|
up large build methods into multiple widgets.This tool can help you debug at least four common performance issues:The whole screen (or large pieces of it) are built by a single
|
StatefulWidget, causing unnecessary UI building. Split up the
|
UI into smaller widgets with smaller build() functions.Offscreen widgets are being rebuilt. This can happen, for example,
|
when a ListView is nested in a tall Column that extends offscreen.
|
Or when the RepaintBoundary is not set for a list that extends
|
offscreen, causing the whole list to be redrawn.The build() function for an AnimatedBuilder draws a subtree that
|
does not need to be animated, causing unnecessary rebuilds of static
|
objects.An Opacity widget is placed unnecessarily high in the widget tree.
|
Or, an Opacity animation is created by directly manipulating the
|
opacity property of the Opacity widget, causing the widget itself
|
and its subtree to rebuild.You can click on a line in the table to navigate to the line
|
in the source where the widget is created. As the code runs,
|
the spinning icons also display in the code pane to help you
|
visualize which rebuilds are happening.Note that numerous rebuilds doesn’t necessarily indicate a problem.
|
Typically you should only worry about excessive rebuilds if you have
|
already run the app in profile mode and verified that the performance
|
is not what you want.And remember, the widget rebuild information is only available in
|
a debug build. Test the app’s performance on a real device in a profile
|
build, but debug performance issues in a debug build.<topic_end>
|
<topic_start>
|
Editing tips for Flutter code
|
If you have additional tips we should share, let us know!<topic_end>
|
<topic_start>
|
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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.