🔤Naming Conventions

Naming conventions

UpperCamelCase: For Classes, Enumerations, and Typedefs.

GoodBad

class HomeLayout {}

class homeLayout {}

enum IntegrationEnv {

dev,

pro,

}

enum integration_env {

dev,

pro,

}

typedef NaviAction = void Function();

typedef naviaction = void Function();

snake_case: Libraries, packages, directories, and file names.

GoodBad

library appflowy_calendar;

library AppFlowy_Calendar;

import 'package:protobuf/protobuf.dart';

import 'package:protobuf/Protobuf.Dart';

appflowy_calendar_block.dart

AppflowyCalendar_block.dart

lowerCamelCase: Variables, constants, and parameters.

GoodBad

let mut item;

let mut Item;

const testValue = 14.28;

const test_value = 14.28;

final urlScheme = RegExp(‘^([a-z]+):’);

final Url_Scheme = RegExp(‘^([a-z]+):’);

void sum(int testValue) { ... }

void sum_of(int test_value) { ... }

Last updated