๐Ÿ”ค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