Skip to main content
← Chapter 1: The Dart Basics Lesson 1.10

Naming Convention

The Effective Dart style guide and its naming conventions provide a set of guidelines for writing Dart code that is easy to read, easy to change, and easy to maintain. The guidelines are intended to be used by all Dart users, whether you are writing a small program or a large-scale application. These guidelines help set a standard across teams and projects.

Practice

  • Use UpperCamelCase for classes, enums, typedefs, extensions and type parameters.
  • Use lowerCamelCase for variable names, function names, parameter names, and named constants.
  • Use lowercase_with_underscores for packages, directories, and source files.
  • Start a name with an underscore (_) only to make it private to its library.
  • Run dart format to format your code the standard way.

Resources