Skip to content

Commit de4d9cd

Browse files
committed
updated content
1 parent f639283 commit de4d9cd

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/ff-concepts/adding-customization/custom-functions.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,32 @@ function code. Instead, you can pass the app state variable as a parameter and t
101101
</details>
102102

103103

104+
<details>
105+
<summary>How do I convert a string to a double in FlutterFlow using a custom function?</summary>
106+
107+
If you need to convert a string (for example, `"123.45"`) into a `double` in FlutterFlow, you can do this with a Custom Function.
108+
109+
Below is a simple Dart example:
110+
111+
```dart
112+
double stringToDouble(String value) {
113+
return double.tryParse(value) ?? 0.0;
114+
}
115+
```
116+
Steps to use in FlutterFlow:
117+
118+
- Go to Custom Functions in the left panel.
119+
- Click + Add Function.
120+
- Name the function (e.g., stringToDouble).
121+
- Add a String parameter (e.g., value).
122+
- Paste the code above.
123+
- Save and use the function anywhere in your app (such as in a binding or conditional logic).
124+
125+
:::tip
126+
- You don’t always need to write your own function — FlutterFlow’s **[Utility Functions Library](https://marketplace.flutterflow.io/item/ZVBmWMGpXe6vqnASRHDA)** already contains a stringToDouble method (and many others) that can save you time.
127+
- You can install it from the Marketplace and use it immediately without creating custom code.
128+
:::
129+
</details>
130+
104131
## Utility Functions Library
105132
Instead of building everything from scratch, explore our **[Utility Functions Library](https://marketplace.flutterflow.io/item/ZVBmWMGpXe6vqnASRHDA)** — packed with 50+ helpful functions for everyday tasks like formatting text, manipulating dates, validating input, and more. Easily plug them into your custom logic to save time and reduce errors.

0 commit comments

Comments
 (0)