What is package naming convention used in Dart?

You only can create flutter project by lowercase and no space between the project name and avoid to add special characters. Follow these steps you will not get any error like this.

"ProjectName" is not a valid Dart package name.


From the [Pubspec format description](https://www.dartlang.org/tools/pub/pubspec.html):

**DO** use `lowercase_with_underscores` for package names.

Package names should be all lowercase, with underscores to separate words,
`just_like_this`.  Use only basic Latin letters and Arabic digits: [a-z0-9_].
Also, make sure the name is a valid Dart identifier -- that it doesn't start
with digits and isn't a reserved word.

All the package conventions are documented on pub.dartlang.org. The package naming conventions in particular are documented on the pubspec format page.


This is documented on the name section of Pubspec Format documentation.

It should be all lowercase, with underscores to separate words, just_like_this. Stick with basic Latin letters and Arabic digits: [a-z0-9_] and ensure that it’s a valid Dart identifier (i.e. doesn’t start with digits and isn’t a reserved word).

Try to pick a name that is clear, terse, and not already in use.


There doesn't seem to be a convention for it, but most of the time, I see lowercase_words_with_underscore being used, both for libraries and packages.

For libraries inside packages, some people also use dots for grouping, for example my_package.lib_1 and my_package.lib_2.

It's all personal preference, I guess.