Tony
Tony

Reputation: 13

new flutter project in vscode has error

when i create a new flutter project in vscode it will immediately shows an error in the main.dart file and gives a gradle error when trying to debug.

shown here: main.dart error

"compiler message: lib/main.dart:68:19: Error: Too few positional arguments: 1 required, 0 given."

I've reinstalled dart and flutter plugins. updated the java install. in debug console i get this: debug console

added output of flutter doctor -v enter image description here

Upvotes: 1

Views: 3078

Answers (2)

Lavina Kathambi
Lavina Kathambi

Reputation: 11

I was also facing the same error, but it was always on my test folder. This is what I did:

  1. On your terminal, make sure you are in your project repository.
  2. Run the flutter pub get command, it worked for me, may be you should try it too.

Upvotes: 1

Danny Tuppeny
Danny Tuppeny

Reputation: 42333

Do you possibly have two different versions of the Flutter SDK on your machine? I wonder if one is being used by flutter create and the other for analysis.

If you're sure you only have one, please open an issue on GitHub and attach a log file for me to investigate.

Upvotes: 0

Related Questions