Debugging Dart in Dartium - Breakpoint keyword?

When debugging Javascript in Chrome Dev Tools, using the 'debugger' reserved keyword hits a breakpoint when opening Dev Tools. Is there an equivalent for debugging dart code in Dartium?

+3


source to share


1 answer


Since Dart SDK 1.11.0 there is a function debugger

in the new dart:developer

one to trigger a breakpoint through code. You can pass an optional condition with a parameter when

and provide an optional message as well.

import 'dart:developer';

void main() {
  debugger();
  print('Not reached when a debugger is attached till the execution is continued');
}

      



If JavaScript is compiled, the keyword is used debugger

.

+4


source







All Articles