Skip to content

Commit b96022a

Browse files
committed
updated the FAQs in the custom-functions.md
1 parent 9b03365 commit b96022a

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
@@ -100,5 +100,32 @@ function code. Instead, you can pass the app state variable as a parameter and t
100100

101101
</details>
102102

103+
<details>
104+
<summary>How do I convert a string to a double in FlutterFlow using a custom function?</summary>
105+
106+
If you need to convert a string (for example, `"123.45"`) into a `double` in FlutterFlow, you can do this with a Custom Function.
107+
108+
Below is a simple Dart example:
109+
110+
```dart
111+
double stringToDouble(String value) {
112+
return double.tryParse(value) ?? 0.0;
113+
}
114+
```
115+
Steps to use in FlutterFlow:
116+
117+
- Go to Custom Functions in the left panel.
118+
- Click + Add Function.
119+
- Name the function (e.g., stringToDouble).
120+
- Add a String parameter (e.g., value).
121+
- Paste the code above.
122+
- Save and use the function anywhere in your app (such as in a binding or conditional logic).
123+
124+
:::tip
125+
- 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.
126+
- You can install it from the Marketplace and use it immediately without creating custom code.
127+
:::
128+
</details>
129+
103130
## Utility Functions Library
104131
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)