Skip to content

Commit 16ebae6

Browse files
committed
Address review comments
1 parent 2fe88a1 commit 16ebae6

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

docs/resources/control-flow/functions/utility-functions.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ To add inline function, open the Set from Variable dialog wherever it's possible
101101
For example, we may want to quickly calculate the discount amount of a product where the discount is 18% of the MRP of the product. The expression would be `cost - (cost * discount)`.
102102

103103
:::tip
104-
Looking for more power and flexibility? Use the new [**Custom Code Expression**](#code-expression). It’s a more advanced version of Inline Functions that lets you access FlutterFlow generated resources without passing them as arguments. You also get real-time autocomplete and inline error checking for faster, more accurate logic.
104+
Looking for more power and flexibility? Use the new [**Custom Code Expression**](#custom-code-expression). It’s a more advanced version of Inline Functions that lets you access FlutterFlow generated resources without passing them as arguments. You also get real-time autocomplete and inline error checking for faster, more accurate logic.
105105
:::
106106

107107
**Precedence of operations**
@@ -166,23 +166,27 @@ Here are some common expressions you can use for your business logic:
166166
| `int.parse(s)` | Convert the **String** into an **integer.** | `int.parse(stringValue)` | `int` |
167167

168168

169-
## Code Expression
169+
## Custom Code Expression
170170

171-
**Code Expression** lets you write short Dart code directly in widget property fields and action flows in FlutterFlow. It’s a more powerful version of [**Inline Function**](#inline-function-code-expressions), allowing you to directly access FlutterFlow generated classes, global variables, widget properties, parameters, and more without needing to manually pass them as inputs.
171+
**Custom Code Expression** lets you write short Dart code directly in widget property fields and action flows in FlutterFlow. It’s a more powerful version of [**Inline Function**](#inline-function-code-expressions), allowing you to directly access FlutterFlow generated classes, global variables, widget properties, parameters, and more without needing to manually pass them as inputs.
172172

173-
Code Expressions also support real-time autocomplete, making it easy to discover available fields as you type. For example, when you type `FFAppState().`, it will suggest all available app state variables along with their types.
173+
Custom Code Expressions also support real-time autocomplete, making it easy to discover available fields as you type. For example, when you type `FFAppState().`, it will suggest all available app state variables along with their types.
174174

175175
In addition, inline validation provides immediate feedback as you write, helping you catch syntax errors or invalid property references.
176176

177+
:::info
178+
To use Custom Code Expression, you must have an active [**FlutterFlow paid plan**](https://www.flutterflow.io/pricing).
179+
:::
180+
177181
:::tip
178-
- To explore what you can access within a code expression, refer to the [**Common Examples**](../../../ff-concepts/adding-customization/common-examples.md) page.
179-
- Press `^ + Space` (or `Ctrl + Space`) while typing to see suggestions for what you can access in your code expression.
182+
- To explore what you can access within a Custom code expression, refer to the [**Common Examples**](../../../ff-concepts/adding-customization/common-examples.md) page.
183+
- Press `^ + Space` (or `Ctrl + Space`) while typing to see suggestions for what you can access in your Custom code expression.
180184
- You can access values inside custom structs. For example, you can use `FFAppState().localDeviceInfo.osVersion` if that field exists in your app state.
181-
- To use code expressions better, it's helpful to understand how FlutterFlow builds your project behind the scenes. You can check the [**State Management**](../../../generated-code/state-mgmt-gen-code.md) page and other **Generated Code** sections to learn how everything is set up.
185+
- To use Custom code expressions better, it's helpful to understand how FlutterFlow builds your project behind the scenes. You can check the [**State Management**](../../../generated-code/state-mgmt-gen-code.md) page and other **Generated Code** sections to learn how everything is set up.
182186

183187
:::
184188

185-
Here are a couple of examples showing how to access App State and Page State within a code expression:
189+
Here are a couple of examples showing how to access App State and Page State within a Custom code expression:
186190

187191
- **App State Access:** For example, to check if dark mode is enabled using an App State variable:
188192

@@ -200,7 +204,7 @@ Here are a couple of examples showing how to access App State and Page State wit
200204

201205
This expression checks if the `searchText` variable (defined as a page state) is empty, and returns an appropriate message. The `_model` object refers to the current page’s generated state model.
202206

203-
Here's an example of adding a Code Expression:
207+
Here's an example of adding a Custom Code Expression:
204208
205209
<div style={{
206210
position: 'relative',
@@ -230,7 +234,7 @@ Here's an example of adding a Code Expression:
230234
231235
### Execute Custom Code [Action]
232236
233-
To use a Code Expression when triggering actions in FlutterFlow (i.e., inside an Action Flow), you can use the **Execute Custom Code** action. This allows you to run a Dart expression when something happens, such as tapping a button or after a page loads.
237+
To use a Custom Code Expression when triggering actions in FlutterFlow (i.e., inside an Action Flow), you can use the **Execute Custom Code** action. This allows you to run a Dart expression when something happens, such as tapping a button or after a page loads.
234238
235239
![execute-custom-code.avif](img/execute-custom-code.avif)
236240
@@ -246,14 +250,14 @@ Learn more about [**Custom Functions**](../../../ff-concepts/adding-customizatio
246250
## FAQS
247251
<details>
248252
<summary>
249-
How is a Code Expression different from an Inline Function?
253+
How is a Custom Code Expression different from an Inline Function?
250254
</summary>
251255
<p>
252-
Code Expressions are a more advanced and flexible version of **Inline Functions.
256+
Custom Code Expression is a more advanced and flexible version of Inline Function.
253257
254-
With Inline Functions, you had to manually pass values as arguments. In contrast, Code Expressions let you directly reference FlutterFlow generated resources (such as `FFAppState()`, `_model`, context, and more) without needing to pass them in.
258+
With Inline Functions, you had to manually pass values as arguments. In contrast, Custom Code Expressions let you directly reference FlutterFlow generated resources (such as `FFAppState()`, `_model`, context, and more) without needing to pass them in.
255259
256-
You can write any valid Dart expression in a code expression, even multi-line logic using anonymous functions. Plus, Code Expressions support real-time autocomplete and inline error validation, making it much easier to discover available variables and avoid mistakes.
260+
You can write any valid Dart expression in a Custom code expression, even multi-line logic using anonymous functions. Plus, Custom Code Expressions support real-time autocomplete and inline error validation, making it much easier to discover available variables and avoid mistakes.
257261
258262
</p>
259263
</details>

0 commit comments

Comments
 (0)