DartPad: How to get more information if the console only prints 'Script Error'?

Viewed 597

For example: If I run this App in DartPad the console only says Script Error. How can I get more information (What is the exact error? Where is it located?, ...)?

1 Answers

Try to wrap your code inside the try-catch block and then print the error on the console.

For example,

try {
   Navigator.of(context).push(MaterialPageRoute(builder: (context) => ScreenTwo()));
} catch (e) {
   print(e);
}
Related