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-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
---
2
2
slug: /resources/style-guide
3
-
title: How to name variables?
3
+
title: Naming Variables
4
4
description: Naming conventions for FlutterFlow, including guidelines for widgets, components, state variables, constants, and more.
5
5
tags: [Style Guide, Variables]
6
6
keywords: [Style Guide, Variables]
7
7
---
8
8
9
9
# Naming Variables
10
10
11
-
Follow a consistent naming convention for variables, functions, and components to make your code more readable and maintainable.
11
+
To make your code more maintainable, readable, and consistent, it’s essential to adopt clear naming conventions for variables, functions, and components.
12
12
13
-
Best practices for naming conventions in app development, especially for projects using Flutter, aim to improve code readability, maintainability, and consistency across the application. Here are some general guidelines tailored for different aspects of a Flutter project:
13
+
Best practices for naming conventions in app development (especially for projects using Flutter), aim to improve code readability, maintainability, and consistency across the application. Here are some general guidelines tailored for different aspects of a Flutter project:
14
14
15
15
Various naming styles (as suggested by [Dart Effective Style Guide](https://dart.dev/effective-dart/style#identifiers)):
16
16
@@ -30,7 +30,7 @@ Various naming styles (as suggested by [Dart Effective Style Guide](https://dart
30
30
31
31
32
32
### Pages & Components
33
-
Use **UpperCamelCase** for all widget, component, page, and screen names to maintain consistency and readability. FlutterFlow ensures clarity by automatically adding "Widget" to widget names when generating code. For components, you can suffix the name with "Component" to clearly distinguish them.
33
+
Use **UpperCamelCase** for all widgets, components, pages, and screen names to maintain consistency and readability. FlutterFlow ensures clarity by automatically adding "Widget" to widget names when generating code. For components, you can suffix the name with "Component" to clearly distinguish them.
34
34
35
35
Similarly, for pages and screens, include "Page" or "Screen" in the name to indicate their purpose. This approach aligns with Dart conventions for class names and ensures a well-organized project structure.
36
36
@@ -65,7 +65,7 @@ When naming custom data types and enums, use UpperCamelCase for consistency and
65
65
66
66
-**Use UpperCamelCase for Custom Data Types:** Name your custom data types using **UpperCamelCase**. Ensure that names are clear, concise, and descriptive, reflecting the entity they represent. Good Examples: `UserModel`, `ProductDetails`, `OrderItem`.
67
67
68
-
-**Use consistent naming for Enum Names and Values:** Use **UpperCamelCase** for the enum name such as `Status`, `ConnectionState`, `UserRole` and **lowerCamelCase** for its values for e.g `{active, inactive, pending}`. This approach aligns with Dart's enum naming guidelines and ensures consistency.
68
+
-**Use consistent naming for Enum Names and Values:** Use **UpperCamelCase** for the enum name such as,`Status`, `ConnectionState`, `UserRole` and **lowerCamelCase** for its values e.g.,`{active, inactive, pending}`. This approach aligns with Dart's enum naming guidelines and ensures consistency.
69
69
70
70
-**Use Plural Names for Lists:** If the data type represents a List, use a plural name to clarify its purpose. Good Example: `OrderItems` (to represent multiple `OrderItem` objects).
0 commit comments