Dart code is not running in Android Studio

Viewed 14

enter image description here

When I click the green button left to void main which says Run main.dart I am presented with this error message. So, how can I then run a simple Dart code from my IDE (Android Studio)?


Note:

This question is NOT about running a Flutter app but the Dart code. So, please don't mark it a duplicate of questions like this.

I also don't want to run dart main.dart command.

1 Answers

I just found that I was importing some Flutter packages in the same file, so once I removed them, I am able to run the app.

Related