Dart Debugging

Dart Debugging

·

1 min read

Debugging :

  • Every now and then, developers commit mistakes while coding.

  • A mistake in a program is referred to as a bug.

  • The process of finding and fixing bugs is called debugging and is a normal part of the development process.

  • This section covers tools and techniques that can help you with debugging tasks.

  • The WebStorm editor enables breakpoints and step-by-step debugging.

  • The program will break at the point where the breakpoint is attached.

  • This functionality is like what you might expect from Java or C# application development.

  • You can watch variables, browse the stack, step over and step into method and function calls, all from the WebStorm Editor.

Adding BreakPoint


void main() { 
   int a = 10, b = 20, c = 5; 
   c = c * c * c; 

   print("$a + $b = ${a+b}"); 
   print("$a%$b = ${a%b}");  // Add a break point here 
   print("$a*$b = ${a*b}"); 
   print("$a/$b = ${a/b}"); 
   print(c); 

}
  • To debug your app's logic, use your IDE, Dart DevTools, or browser tools. Dart DevTools has better support than browser tools for inspecting and automatically reloading Dart code.