Skip to content

Commit 011a53d

Browse files
authored
Merge pull request #413 from FlutterFlow/fix/custom-class-in-library
Add FAQ section on using custom classes in Library Projects
2 parents 113a0b8 + de3297f commit 011a53d

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,4 +459,15 @@ You can access the custom enums from **Set from Variable** menu > **Custom Enum*
459459
- Keep your custom class files modular and focused; ideally one class per file for better organization and reusability.
460460
- Avoid advanced Dart features that are not supported by FlutterFlow’s parser, such as generics or function-typed fields.
461461
- Re-parse your code after making changes to ensure FlutterFlow updates the parsed structure correctly.
462-
- Document your code with comments to make your custom classes easier to understand and maintain over time.
462+
- Document your code with comments to make your custom classes easier to understand and maintain over time.
463+
464+
## FAQs
465+
466+
<details>
467+
<summary>
468+
Can I add Custom Classes (Code Files) in a Library Project?
469+
</summary>
470+
<p>
471+
Yes, you can. When a Library Project is imported, any custom code files you’ve defined will be parsed, and the resulting classes will be available for use in the consuming project.
472+
</p>
473+
</details>

docs/resources/projects/libraries.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ Once the library is imported, following resources are accessible for use:
188188
- [API Calls](../../resources/control-flow/backend-logic/api/rest-api.md)
189189
- [Action Blocks](../../resources/control-flow/functions/action-blocks.md)
190190
- [Custom Functions](../../ff-concepts/adding-customization/custom-functions.md), [Actions](../../resources/control-flow/functions/action-flow-editor.md), and [Widgets](../../resources/ui/widgets/intro-widgets.md)
191-
- [Assets](../../resources/projects/settings/general-settings.md#app-assets) (Note: These are not versioned)
191+
- [Assets](../../resources/projects/settings/general-settings.md#app-assets) (Note: These are not versioned)
192+
- [Code Files](../../ff-concepts/adding-customization/code-file.md)
192193

193194
:::info
194195
- [**Pages**](../../resources/ui/pages/intro-pages.md), [**Firestore Collections**](../../ff-integrations/database/cloud-firestore/creating-collections.md), and [**Cloud Functions**](../../ff-concepts/adding-customization/cloud-functions.md) are still being worked on and may come in future updates.
@@ -199,7 +200,8 @@ It's important to note that these resources show up where they are instantiated.
199200

200201
- **Components** appear in the widget palette.
201202
- **API calls** appear when making API calls in the action flow editor.
202-
- **Custom functions** are available when setting up actions or functions within the app.
203+
- **Custom Functions** are available when setting up actions or functions within the app.
204+
- **Code Files** (Dart files containing classes or enums) become available when [creating instances](../../ff-concepts/adding-customization/code-file.md#create-custom-class-instance), allowing you to access their fields and methods. They also appear in the action flow editor when adding [custom class actions](../../ff-concepts/adding-customization/code-file.md#set-field-action).
203205

204206
This ensures that only relevant resources are shown where they are needed, optimizing performance and discoverability.
205207

0 commit comments

Comments
 (0)