Skip to content

brahimkh/brahimkh-flutter-dart-guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Flutter And Dart Guide

Introduction

The Flutter and Dart Guide serves as a tool to expedite developers' work by facilitating collaboration, simplifying learning, enhancing code readability, and promoting standardization within our company. Additionally, we must prepare documents for the CUBETIQS government, All members have created by Man Brahim, Chea Kit and Son Phumrin are included.

Dart Programming

Style

Style is an essential aspect of good coding practice. It emphasizes consistent naming conventions, logical ordering, and proper formatting, which collectively contribute to the clarity and readability of code.

Identifiers

Identifiers come in three flavors in Dart.

  • UpperCamelCase names capitalize the first letter of each word, including the first.

  • lowerCamelCase names capitalize the first letter of each word, except the first which is always lowercase, even if it's an acronym.

  • lowercase_with_underscores names use only lowercase letters, even for acronyms, and separate words with _.

Example

  • Using UpperCamelCase
BadGood
class Menucontroller {...}

class httpRequest {...}

typedef predicate <T> = bool Function(T value);
class MenuController {...}

class HttpRequest {...}

typedef Predicate <T> = bool Function(T value);
  • Using lowerCamelCase
BadGood
const PI = 3.14;
const DefaultTimeout = 1000;
final URL_SCHEME = RegExp('^([a-z]+):');

class Dice {
  static final NUMBER_GENERATOR = Random();
}
const pi = 3.14;
const defaultTimeout = 1000;
final urlScheme = RegExp('^([a-z]+):');

class Dice {
  static final numberGenerator = Random();
}
  • lowercase_with_underscores
BadGood
mypackage
└─ lib
   └─ file-system.dart
   └─ SliderMenu.dart
my_package
└─ lib
   └─ file_system.dart
   └─ slider_menu.dart

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published