You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/resources/style-guide.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,8 @@ When naming custom data types and enums, use **UpperCamelCase** for consistency
90
90
-**Don’t Mix Naming Conventions for Enums:** Maintain consistent capitalization between enum names and their values. Bad Example: `enum UserRole { Admin, EDITOR, viewer }`
91
91
:::
92
92
93
+
For datatype fields, we use the same convention as [State variables](#variables).
94
+
93
95
### Constants
94
96
95
97
Flutter prefers using a lowercase `k` prefix for constants to indicate their immutability, especially for project-specific constants. This approach is more concise and aligns with Dart's common practices. Use **SCREAMING_SNAKE_CASE** only when contributing to global or legacy projects where it is already in use.
@@ -104,9 +106,9 @@ Flutter prefers using a lowercase `k` prefix for constants to indicate their imm
104
106
-**Don’t Use Vague or Generic Names:** Avoid using names that fail to describe the purpose of the constant. Bad Examples: `VALUE`, `DATA`, `X`, `Y`.
105
107
:::
106
108
107
-
### State Variables
109
+
### Variables
108
110
109
-
State variable names follow the **lowerCamelCase** naming style to align with Dart's conventions.
111
+
State variable & Data Type field names follow the **lowerCamelCase** naming style to align with Dart's conventions.
110
112
111
113
:::tip[Do's]
112
114
-**Be Descriptive and Clear:** Use variable names that clearly describe their purpose, avoiding generic or vague terms. Examples: `isFormValid`, `errorMessage`, `availableProducts`.
@@ -117,7 +119,7 @@ State variable names follow the **lowerCamelCase** naming style to align with Da
117
119
:::danger[Don'ts]
118
120
-**Don’t Use Abbreviations or Single Letters:** Avoid abbreviations or single-character names that obscure the variable's intent. Bad Examples: `usrNm`, `f`, `cnt`.
119
121
-**Don’t Use Generic Names:** Avoid using generic terms that do not convey the variable’s purpose. Bad Examples: `data`, `value`, `temp`.
120
-
-**Don’t Start State Variables with Uppercase:** Follow Dart conventions by starting variable names with lowercase. Bad Examples: `UserName`, `IsLoading`.
122
+
-**Don’t Start Variables with Uppercase:** Follow Dart conventions by starting variable names with lowercase. Bad Examples: `UserName`, `IsLoading`.
0 commit comments