Skip to content

Commit 993acf7

Browse files
committed
improved formatting, updated content.
1 parent ff4e2ae commit 993acf7

File tree

2 files changed

+87
-82
lines changed

2 files changed

+87
-82
lines changed

docs/troubleshooting/custom-actions/custom_actions_troubleshooting.md

Lines changed: 77 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -8,117 +8,123 @@ title: Custom Actions Troubleshooting
88
Custom actions in FlutterFlow are powerful, but troubleshooting them can be tricky. This guide will help you systematically resolve common issues.
99

1010

11-
## 1. Read the Error Message
11+
1. **Read the Error Message**
1212

13-
Always read the error message printed during test mode, compilation, or local build. The message often provides a clue about the potential issue.
13+
Always read the error message printed during test mode, compilation, or local build. The message often provides a clue about the potential issue.
1414

15-
## 2. Common Troubleshooting Checklist
15+
2. **Common Troubleshooting Checklist**
1616

17-
### Action Name Mismatch
18-
- Ensure the name in the action matches the custom action in your code.
17+
- **Action Name Mismatch**
1918

20-
![](../assets/20250430121138021235.png)
19+
Ensure the name in the action matches the custom action in your code.
2120

22-
:::tip
23-
Use the **Add BoilerPlate Code** option to generate code with the correct action name.
24-
:::
21+
![](../assets/20250430121138021235.png)
2522

26-
### Imports and Arguments
23+
:::tip
24+
Use the **Add BoilerPlate Code** option to generate code with the correct action name.
25+
:::
2726

28-
- Do all imports match those declared in the action settings?
29-
- Are all arguments passed within the builder itself?
27+
- **Imports and Arguments**
3028

31-
![](../assets/20250430121138830209.png)
29+
- Do all imports match those declared in the action settings?
30+
- Are all arguments passed within the builder itself?
3231

33-
Example:
34-
- Argument 1: Missing definition in settings panel
35-
- Argument 2: Correctly imported
36-
- Argument 3: Nullable selected, but not specified as nullable in code
32+
![](../assets/20250430121138830209.png)
3733

38-
How to fix:
39-
1. Manually update arguments in both the settings panel and your code.
40-
2. Use the **Add BoilerPlate Code** option (on web, copy only what you need; on desktop, it may replace all code).
34+
Example:
4135

42-
![](../assets/20250430121139816551.gif)
36+
- Argument 1: Missing definition in settings panel
37+
- Argument 2: Correctly imported
38+
- Argument 3: Nullable selected, but not specified as nullable in code
4339

44-
### Name Conflicts
40+
How to fix:
4541

46-
- Avoid using the same name for the action and any argument.
42+
1. Manually update arguments in both the settings panel and your code.
43+
2. Use the **Add BoilerPlate Code** option (on web, copy only what you need; on desktop, it may replace all code).
4744

48-
![](../assets/20250430121142594662.png)
45+
![](../assets/20250430121139816551.gif)
4946

50-
### Reserved Keywords
47+
- **Name Conflicts**
5148

52-
- Do not use Dart/Flutter reserved keywords as argument names.
53-
- **Examples:** `abstract`, `else`, `import`, `show`, `as`, `enum`, `in`, `static`, `this`
54-
*FlutterFlow usually warns you, but double-check!*
49+
- Avoid using the same name for the action and any argument.
5550

56-
### Return Type Mismatch
57-
- Ensure the custom action returns the correct data type as defined in the settings.
51+
![](../assets/20250430121142594662.png)
5852

59-
![](../assets/20250430121143268592.png)
53+
- **Reserved Keywords**
6054

61-
*The function should return the type specified in the settings panel.*
55+
- Do not use Dart/Flutter reserved keywords as argument names. **Examples:** `abstract`, `else`, `import`, `show`, `as`, `enum`, `in`, `static`, `this`.
56+
*FlutterFlow usually warns you, but double-check!*
6257

63-
### Internal Library Imports
64-
- If importing internal libraries (e.g., `../../flutterflow`), set **Exclude from compilation** to `true` if needed.
58+
- **Return Type Mismatch**
6559

66-
### Pubspec Dependencies
67-
- Are all required dependencies included in both the code and the PubSpec?
60+
- Ensure the custom action returns the correct data type as defined in the settings.
6861

69-
![](../assets/20250430121143614166.png)
62+
![](../assets/20250430121143268592.png)
7063

71-
- Check for:
72-
- Version conflicts (check on [pub.dev](https://pub.dev))
73-
- Multiple versions of the same dependency
74-
- Conflicts with FlutterFlow's auto-imported dependencies
64+
*The function should return the type specified in the settings panel.*
7565

76-
![](../assets/20250430121143935249.png)
66+
- **Internal Library Imports**
7767

78-
![](../assets/20250430121144228150.png)
68+
- If importing internal libraries (e.g., `../../flutterflow`), set **Exclude from compilation** to `true` if needed.
7969

80-
### Code Errors
81-
- **Null values:**
70+
- **Pubspec Dependencies**
8271

83-
```dart
84-
int example = passingIntWhichMayBeNullable ?? 0;
85-
```
86-
- **Correct data types:**
72+
- Are all required dependencies included in both the code and the PubSpec?
8773

88-
```dart
89-
String numberAsString = "5";
90-
int example = thisWord; // ❌ Passing a string to an int
91-
```
92-
Use `.toString()`, `.toInt()`, `.toDouble()` as needed.
74+
![](../assets/20250430121143614166.png)
9375

94-
- **Single elements** vs **arrays:**
95-
- Ensure you are not passing a single element where a list is expected, or vice versa.
76+
Check for:
77+
- Version conflicts (check on **[pub.dev](https://pub.dev)**)
78+
- Multiple versions of the same dependency
79+
- Conflicts with FlutterFlow's auto-imported dependencies
9680

97-
### Exclude from Compilation
98-
If this is checked, code will not be error-checked during compilation, but will still run in Test/Run Mode.
81+
![](../assets/20250430121143935249.png)
9982

100-
![](../assets/20250430121144509497.png)
83+
![](../assets/20250430121144228150.png)
10184

102-
### Duplicate Data Types/Structs
103-
- Do not redefine data types or structs already defined in FlutterFlow's data schema panel.
85+
- **Code Errors**
10486

105-
![](../assets/20250430121144853131.png)
87+
- **Null values:**
10688

107-
### Callback Data Types
108-
- Ensure callback actions return the correct data type.
89+
```js
90+
int example = passingIntWhichMayBeNullable ?? 0;
91+
```
92+
- **Correct data types:**
10993

110-
![](../assets/20250430121145202849.png)
94+
```js
95+
String numberAsString = "5";
96+
int example = thisWord; // ❌ Passing a string to an int
97+
```
98+
Use `.toString()`, `.toInt()`, `.toDouble()` as needed.
11199

100+
- **Single elements** vs **arrays:**
101+
- Ensure you are not passing a single element where a list is expected, or vice versa.
112102

113-
## 3. Additional Resources
103+
- **Exclude from Compilation**
114104

105+
If this is checked, the code will not be error-checked during compilation, but will still run in Test/Run Mode.
106+
107+
![](../assets/20250430121144509497.png)
108+
109+
- **Duplicate Data Types/Structs**
110+
111+
- Do not redefine data types or structs already defined in FlutterFlow's data schema panel.
112+
113+
![](../assets/20250430121144853131.png)
114+
115+
- **Callback Data Types**
116+
117+
- Ensure callback actions return the correct data type.
118+
119+
![](../assets/20250430121145202849.png)
120+
121+
122+
:::info[Additional Resources]
115123
- **Debugging with the Browser Console:**
116124
- Use the browser debug console for logic errors.
117-
- **FlutterFlow University Video:**
118-
- [Custom Actions Video](https://www.youtube.com/watch?v=YOUR_VIDEO_LINK)
119-
- **Official Docs:**
120-
- [Custom Actions | FlutterFlow Docs](https://docs.flutterflow.io/custom-actions)
121-
125+
- **FlutterFlow University Video:** [Custom Actions Video](https://www.youtube.com/watch?v=rKaD9eKuZkY).
126+
- **Official Docs:** [Custom Actions | FlutterFlow Docs](/concepts/custom-code/custom-actions/)
127+
:::
122128

123129
:::tip
124130
When in doubt, regenerate the boilerplate and compare with your code. Consistency between settings and code is key!

docs/troubleshooting/custom-actions/testing_custom_actions_using_debug_console.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,24 @@ title: Testing Custom Actions using Debug Console
55
---
66
# Testing Custom Actions using Debug Console
77

8-
## Background
9-
108
Sometimes, the compiler does not show any errors in the custom action, but the custom action still won't work as expected. This might be due to the code logic or the implementation. In order to test the implementation and the flow, you can use the debug console to test the custom action in different scenarios.
119

12-
## Steps for Implementation:
10+
**Steps for Implementation**:
1311

1412
The core function that you can use to test the custom actions on the console is the **debugPrint** function in Flutter. To use that in the custom actions, follow these steps:
1513

16-
### Step 1
14+
- **Step 1**
1715

18-
Use debugPrint to print some error on the debug console in case of a specific result. You can use if-else statements or try-catch statements in order to test the success of the scenario:​
16+
Use debugPrint to print some error on the debug console in case of a specific result. You can use if-else statements or try-catch statements in order to test the success of the scenario:​
1917

20-
![](../assets/20250430121216632942.png)
18+
![](../assets/20250430121216632942.png)
2119

22-
### Step 2
20+
- **Step 2**
2321

24-
After the correct implementation in the code, use the action inside the app. On the run mode, open the console. Now you should be able to see the errors in the console upon performing the action.
22+
After the correct implementation in the code, use the action inside the app. On the run mode, open the console. Now you should be able to see the errors in the console upon performing the action.
2523

26-
![](../assets/20250430121216962021.png)
24+
![](../assets/20250430121216962021.png)
2725

28-
## Still having issues?
29-
If you are still running into issues in your implementation after following the outlined steps, please contact support via chat in-app or email at [email protected].​
26+
:::info[Still having issues?]
27+
If you are still running into issues in your implementation after following the outlined steps, please contact support at [email protected].​
28+
:::

0 commit comments

Comments
 (0)