Skip to content

Commit e5c880c

Browse files
authored
Add images style guide (#263)
* add references to style guid doc * add dos donts images for style guide
1 parent c386e1a commit e5c880c

File tree

8 files changed

+21
-3
lines changed

8 files changed

+21
-3
lines changed

docs/resources/data-representation/constants.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,8 @@ Constants don't change. Once you set its value (in builder), you can't change it
4242
allowFullScreen
4343
allow="clipboard-write">
4444
</iframe>
45-
</div>
45+
</div>
46+
47+
:::tip[Naming Convention]
48+
Prefer 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. To learn more, refer to the guide on **[Naming Variables & Functions](../../resources/style-guide.md)**.
49+
:::

docs/resources/data-representation/custom-data-types.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ To create a custom data type, specify its name and the corresponding fields. Eac
6262
</iframe>
6363
</div>
6464

65+
:::tip[Naming Convention]
66+
When naming custom data types, always use **UpperCamelCase**, as recommended by the Dart Style Guide. To learn more, refer to the guide on **[Naming Variables & Functions](../../resources/style-guide.md)**.
67+
:::
68+
6569
## Accessing Custom Data Type
6670

6771
After creating the custom data type, you can use it to create variables, such as an app state variable, and then access them. Here's an [example](app-state.md#app-state-variables).

docs/resources/data-representation/data-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Composite data types are made up of primitive data types. They can hold multiple
2323
You can also create your own custom data types. This can be especially useful when you need a specific structure for your data that doesn't fit into the predefined types. For example, you might create a custom data type for a user profile, which includes several pieces of data like a name, an email address, and a profile picture.
2424

2525
:::info
26-
Learn more about creating and using custom data types [**here**](custom-data-types).
26+
Learn more about creating and using [**Custom Data Types**](custom-data-types).
2727
:::
2828

2929
## Built-in Data Types

docs/resources/data-representation/enums.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,8 @@ Here are some real-world examples where using Enums is beneficial:
5353

5454
2. Access the Enum values by navigating to the **Set from Variable** menu, then selecting **Enums > [your enum name] > Values**.
5555

56-
![enums.avif](../imgs/enums.avif)
56+
![enums.avif](../imgs/enums.avif)
57+
58+
:::tip[Naming Convention]
59+
When naming enums, always use **UpperCamelCase**, and for enum values, use **lowerCamelCase**, as recommended by the Dart Style Guide. To learn more, refer to the guide on **[Naming Variables & Functions](../../resources/style-guide.md)**.
60+
:::
57.6 KB
Loading
58 KB
Loading
24.1 KB
Loading

docs/resources/style-guide.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Use **UpperCamelCase** for all widgets, components, pages, and screen names to m
3737

3838
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.
3939

40+
![comp-style-guide.png](imgs/comp-style-guide.png)
41+
4042
:::tip[Do's]
4143
- **Use UpperCamelCase for Names:** Always use **UpperCamelCase** for widgets, components, pages, and screens. Examples: `CustomButton`, `UserProfilePage`, `MainViewComponent`.
4244

@@ -68,6 +70,8 @@ Note that the style guidelines for Pages and Components also apply to **[Custom
6870

6971
When naming custom data types and enums, use **UpperCamelCase** for consistency and clarity. Ensure that names are descriptive, providing a clear representation of the entity or purpose.
7072

73+
![dt-style-guide.png](imgs/dt-style-guide.png)
74+
7175
:::tip[Do's]
7276

7377
- **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`.
@@ -123,6 +127,8 @@ This section defines naming conventions for custom functions, actions, and actio
123127

124128
Custom functions and custom actions created in the Custom Code tab of FlutterFlow should follow the **lowerCamelCase** naming convention. These typically reflect an action or behavior.
125129

130+
![func-style-guide.png](imgs/func-style-guide.png)
131+
126132
:::tip[Do's]
127133
- **Be descriptive and concise:** Use clear, meaningful names that describe the action or purpose of the function (e.g., `validateForm` instead of `doCheck`, or `fetchUserData` instead of `userData`).
128134
- **Use action-oriented names:** Start with verbs to indicate behavior (e.g., `submitForm`, `processPayment`).

0 commit comments

Comments
 (0)