Skip to content

Commit d873efd

Browse files
committed
Add code snippet for ReviewStatus enum
1 parent aa11353 commit d873efd

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ You need to create an instance of a class so you can work with actual data and u
139139
);
140140
```
141141

142-
- You can reuse the same class structure multiple times with different review data.
142+
- In FlutterFlow, you will store the instance of the custom class in the [state variables](../../ff-concepts/state-management/state-variables.md#state-variables) of your app, page, or component.
143+
- You can create multiple instances of the same class, reusing the same structure multiple times, each with different review data.
143144

144145
When you create an instance of a class, you can:
145146

@@ -412,7 +413,15 @@ Use the **Call Static Method** action to run a static method of your class. For
412413
413414
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.
414415
415-
For example, you could define an enum called `ReviewStatus` with values like `pending`, `approved`, and `rejected`.
416+
For example, you could define an enum called `ReviewStatus` with values like `pending`, `approved`, and `rejected`. Here's the code snippet for it:
417+
418+
```jsx
419+
enum ReviewStatus {
420+
pending,
421+
approved,
422+
rejected,
423+
}
424+
```
416425

417426
![custom-enums.avif](imgs/custom-enums.avif)
418427

0 commit comments

Comments
 (0)