Skip to content

Add FAQ section on using custom classes in Library Projects #413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/ff-concepts/adding-customization/code-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,4 +459,15 @@ You can access the custom enums from **Set from Variable** menu > **Custom Enum*
- Keep your custom class files modular and focused; ideally one class per file for better organization and reusability.
- Avoid advanced Dart features that are not supported by FlutterFlow’s parser, such as generics or function-typed fields.
- Re-parse your code after making changes to ensure FlutterFlow updates the parsed structure correctly.
- Document your code with comments to make your custom classes easier to understand and maintain over time.
- Document your code with comments to make your custom classes easier to understand and maintain over time.

## FAQs

<details>
<summary>
Can I add Custom Classes (Code Files) in a Library Project?
</summary>
<p>
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.
</p>
</details>
6 changes: 4 additions & 2 deletions docs/resources/projects/libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ Once the library is imported, following resources are accessible for use:
- [API Calls](../../resources/control-flow/backend-logic/api/rest-api.md)
- [Action Blocks](../../resources/control-flow/functions/action-blocks.md)
- [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)
- [Assets](../../resources/projects/settings/general-settings.md#app-assets) (Note: These are not versioned)
- [Assets](../../resources/projects/settings/general-settings.md#app-assets) (Note: These are not versioned)
- [Code Files](../../ff-concepts/adding-customization/code-file.md)

:::info
- [**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.
Expand All @@ -199,7 +200,8 @@ It's important to note that these resources show up where they are instantiated.

- **Components** appear in the widget palette.
- **API calls** appear when making API calls in the action flow editor.
- **Custom functions** are available when setting up actions or functions within the app.
- **Custom Functions** are available when setting up actions or functions within the app.
- **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).

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

Expand Down