• Use PascalCase for class names.
  • Use camelCase for variable and function names.
  • Use underscore_notation for file names, aligning with the folder name.

Class Names

In Flutter, class names should follow the PascalCase convention, where each word, including the first, is capitalized. Example:
class UserProvider {
  // class logic
}

Variable and Function Names

Variables and functions in Flutter adopt the camelCase convention, where the first letter of each word except the first is capitalized. Example:
String userName = 'Jane';
bool isUserLoggedIn = false;

void updateUserProfile() {
  // function logic
}

File Names

File names in Flutter employ underscore notation, typically reflecting the parent folder’s name. For example, user_provider.dart (with the parent folder named providers) or user_model.dart are exemplary file names. This convention aids in file identification and organization, making the project structure more intuitive. Example:
// File located in lib/providers/user_provider.dart
Adhering to these naming conventions ensures consistency and readability across your Flutter project, facilitating easier maintenance and collaboration.