Note:
  If you are looking for a way to use GDB to remotely debug the
  Flutter engine running within an Android app process,
  check out flutter_gdb.

Debugging Dart code

Use your IDE for standard Dart debugging.
These instructions describe Android Studio,
but you can use your preferred IDE with the
Flutter and Dart plugins installed and configured.

Tip:
  Connect to a physical device when debugging,
  rather than an emulator or simulator,
  which don’t support profile mode.
  For more information, see Flutter’s modes.

Dart debugger

Open your project in Android Studio.
If you don’t have a project yet,
create one using the instructions in Test drive.

Simultaneously bring up the Debug pane and
run the app in the Console
view by clicking the bug icon
().