Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am getting the following error on running flutter create my_appName: "my_appName" is not a valid Dart package name

enter image description here

I have tried upgrading flutter to the latest version. I am still getting the same error.

like image 402
Shehzadahmad_ Avatar asked Sep 07 '25 19:09

Shehzadahmad_


1 Answers

I was getting the exact same error.
After Renaming my working directory as per the naming convention attached by the Flutter team here which @Rushikesh just mentioned. It worked for me..
The reason is that the Flutter SDK uses directory/folder names as packages names and I was using a hyphen in my directory name. In your case mybmicalculator or my_bmi_calculator might work instead of myBmiCalculator .
Give it a try, that might be one of the errors.

like image 59
Syed M Abbas Haider Taqvi Avatar answered Sep 09 '25 18:09

Syed M Abbas Haider Taqvi