Skip to content

Commit 02fbbbb

Browse files
committed
Address review comment
1 parent d106a3e commit 02fbbbb

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

docs/ff-concepts/adding-customization/code-file.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ FlutterFlow allows you to add your own custom Dart files with [classes](https://
2929

3030
To add a custom class, go to the **Custom Code** from the left navigation menu, click **plus (+)** button, and select **Code File**. Set the name of the file, add your code, and hit the **Save** button. Now, you must **validate** your code in the editor to catch basic syntax errors. If there are no errors, click the **Parse** button. FlutterFlow will scan your code and automatically detect supported classes and enums.
3131

32-
Here’s an example of adding a Review custom class:
32+
Here’s an example of adding a `Review` custom class:
3333

3434
<div style={{
3535
position: 'relative',
@@ -57,7 +57,7 @@ Here’s an example of adding a Review custom class:
5757
</div>
5858
<p></p>
5959

60-
Here's the code snippet of the Review custom class:
60+
Here's the code snippet of the `Review` custom class:
6161

6262
```jsx
6363
class Review {
@@ -114,6 +114,9 @@ class Review {
114114
}
115115
}
116116
```
117+
:::tip
118+
You can also include import statements and access generated classes within your custom class files. For more details, [**see the examples**](common-examples.md) on how to access generated classes.
119+
:::
117120

118121
## Create Custom Class Instance
119122

@@ -173,7 +176,7 @@ To create an instance of a custom class, open the **Set from Variable** dialog a
173176
</div>
174177
<p></p>
175178

176-
:::tip[When You Don't Need an Instance]
179+
<!-- :::tip[When You Don't Need an Instance]
177180
178181
You can skip instance creation when everything in the class is `static`, meaning it's shared across all uses (like a utility class). For example, look at the class below:
179182

@@ -186,7 +189,7 @@ class Utils {
186189
In such cases, you can directly access the class data and methods via the **Set from Variable** menu.
187190

188191
![static-class-methods.avif](imgs/static-class-methods.avif)
189-
:::
192+
::: -->
190193

191194
## Using Custom Class
192195

@@ -208,7 +211,7 @@ You can use custom class fields to display values directly in the UI, and call i
208211

209212
You can also add your custom class’s methods directly within an Action Flow. For example, you can trigger the `markHelpful()` method when a user taps a “Mark as Helpful” button to update a field or increment the helpful count of a review.
210213

211-
## Enums
214+
## Custom Enums
212215

213216
Similar to how you add a custom class, you can also add Custom Enums in your app. [Enums](../../resources/data-representation/enums.md) are a great way to define a fixed set of values, such as user roles, order statuses, or content types. Once parsed, these enums become available throughout your app and can be used in dropdowns, conditionals, and UI bindings.
214217

0 commit comments

Comments
 (0)