For example:

Tracing Dart code

To perform a performance trace,
you can use the DevTools Timeline view.
The Timeline view also supports importing
and exporting trace files. For more
information, see the Timeline view docs.

You can also
perform traces programmatically,
though these traces can’t be imported
into DevTool’s Timeline view.

Be sure to use run your app in profile mode
before tracing to ensure that the runtime performance
characteristics closely matches that of your final product.

Performance overlay

To get a graphical view of the performance of your application,
turn on the performance overlay. You can do this in the
by clicking the Performance Overlay button in the
Flutter inspector.

You can also turn on the overlay programmatically.

For information on how to interpret the graphs in the overlay,
see The performance overlay in
the Flutter performance profiling guide.

Debug flags