Skip to content

Commit caf7886

Browse files
authored
Merge pull request #152 from FlutterFlow/pooja/library-fix
Disabled Features Info in Libraries
2 parents f31c415 + 42734fc commit caf7886

File tree

1 file changed

+100
-42
lines changed

1 file changed

+100
-42
lines changed

docs/resources/projects/libraries.md

+100-42
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,33 @@ import TabItem from '@theme/TabItem';
1111

1212
# Libraries
1313

14-
In FlutterFlow, a project can either be used to create an App or used to create a Library. A library allows you to share and reuse resources created in FlutterFlow across multiple projects. More specifically, with libraries, you can publish components, API calls, custom code, and more - all with version control. By using libraries, development becomes more efficient and scalable.
14+
Libraries enables you to share and reuse entire FlutterFlow projects as dependencies across multiple projects. This allows teams and developers to modularize their apps by creating shared libraries that include components, API calls, custom code, and more. By using libraries, development becomes more efficient and scalable.
1515

16-
Imagine you're building an e-commerce app, and different teams are working on various features. One team develops a complex payment system. By using libraries, they can publish the payment system as a reusable library and allow other teams to easily import and integrate it into multiple projects without duplicating development efforts.
17-
18-
![libraries.avif](imgs/libraries.avif)
19-
20-
:::tip[possible usecases]
16+
:::info
17+
A **Dependency** refers to an external library or resource that your project relies on to function correctly. When you create a new FlutterFlow project, certain dependencies are automatically added to support the generated code. Also, when you use a [Custom Widget](../../ff-concepts/adding-customization/custom-widgets.md), you are essentially adding dependencies to your project. Libraries take this concept further by allowing you to add entire FlutterFlow projects as dependencies.
18+
:::
2119

22-
- **Modular Development**: Build large-scale apps by separating them into smaller, independently managed projects (e.g., UI library, backend integrations, etc.).
23-
- **Team Collaboration**: Share reusable UI components, custom functions, or API integrations across multiple apps
24-
- **Community Sharing**: Publish libraries that can be imported and reused by the broader FlutterFlow community - like UI Kits or utility functions.
20+
Imagine you're building an e-commerce app, and different teams are working on various features. One team develops a complex payment system. By using the Libraries, they can publish the payment system as a reusable library and allow other teams to easily import and integrate it into multiple projects without duplicating development efforts.
2521

26-
:::
22+
![libraries.avif](imgs/libraries.avif)
2723

28-
### What’s Included When Importing a Library
24+
### Importance of Libraries
2925

30-
When you import a library into a FlutterFlow project, the following resources are accessible for use:
26+
Previously, FlutterFlow offered several methods to share resources between projects, such as team code libraries, design systems, API libraries, and by leveraging marketplace items. However, these methods had limitations, including the inability to share custom data types or custom functions alongside components or API calls and the absence of version control.
3127

32-
- [Components](../resources/ui/components/intro-components.md)
33-
- [Data Types & Enums](../resources/data-representation/custom-data-types.md)
34-
- [App State Variables](../resources/data-representation/app-state.md)
35-
- [Constants](../resources/data-representation/constants.md)
36-
- [API Endpoints](../resources/control-flow/backend-logic/api/rest-api.md)
37-
- [Action Blocks](../resources/control-flow/functions/action-blocks.md)
38-
- [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)
39-
- [Assets](../resources/projects/settings/general-settings.md#app-assets) (Note: These are not versioned)
28+
With Libraries, you can publish the complete FlutterFlow project as a library and import it as a dependency into other projects.
4029

41-
:::note
30+
:::tip[possible usecases]
4231

43-
Pages and Firestore Collections are still being worked on and may come in future updates.
32+
- **Modular Development**: Build large-scale apps by separating them into smaller, independently managed projects (e.g., UI library, backend integrations, etc.).
33+
- **Team Collaboration**: Share reusable UI components, custom functions, or API integrations across multiple apps within a team.
34+
- **Community Sharing**: Publish libraries that can be imported and reused by the broader FlutterFlow community.
4435

4536
:::
4637

4738
## Publishing a Library
4839

49-
To publish a project as a library, start by creating a FlutterFlow project as you normally would. Next, go to the **Publish as a Library** page in **App Settings**. Here you can specify the version number and message for the version you are publishing.
40+
To publish a FlutterFlow project as a library, start by creating a FlutterFlow project as you normally would, then follow these steps:
5041

5142
<div style={{
5243
position: 'relative',
@@ -81,6 +72,26 @@ To publish a project as a library, start by creating a FlutterFlow project as yo
8172
- It's recommended to include a message that tells users what has changed in the version your are publishing.
8273
:::
8374

75+
### Disabled Features in a Library
76+
77+
When a project is converted into a library, the following features are disabled to ensure compatibility and functionality limitations:
78+
79+
- App settings
80+
- Firebase
81+
- Development environment
82+
- Authentication
83+
- Push notifications
84+
- Mobile deployment
85+
- Web deployment
86+
- Stripe
87+
- Braintree
88+
- Razorpay
89+
- Google Analytics
90+
- OneSignal
91+
- Mux
92+
- Cloud functions
93+
- Firestore Collections
94+
8495
## Importing a Library
8596

8697
To import a library project into another FlutterFlow project, you must go to the **Project Dependencies** page in **App Settings**. Here you can specify the library project and version you are importing.
@@ -123,25 +134,7 @@ To import a library project into another FlutterFlow project, you must go to the
123134
:::
124135

125136

126-
You can easily upgrade to newer versions of the libraries as they become available. If a new update causes issues with your existing implementation, you also have the option to revert to a previous version.
127-
128-
![update-library.avif](imgs/update-library.avif)
129-
130-
## Access Library Resources
131-
132-
Once the library is imported, components and resources are accessible within the project. It's important to note that these resources show up where they are instantiated. For example:
133-
134-
- **Components** appear in the widget palette.
135-
- **API calls** appear when making API calls in the action flow editor.
136-
- **App State variables** appear where you can update app state in an action or leverage app state in a widget property.
137-
- **Custom functions** are available when setting up actions or functions within the app.
138-
139-
This ensures that only relevant resources are shown where they are needed, optimizing performance and discoverability.
140-
141-
![access-library-resources.avif](imgs/access-library-resources.avif)
142-
143-
144-
### Manage Dependency Conflict while Import
137+
### Dependency Conflicts
145138

146139
A **Dependency Conflict** occurs when two or more libraries added by a project depend on different versions of the same dependency. This creates a situation where the project cannot resolve which version to use, leading to a project error.
147140

@@ -167,6 +160,71 @@ Follow these steps to ensure both libraries rely on the same version of Componen
167160
2. **Modify Libraries**: If you have access to the library projects, adjust the dependencies of either User Auth Library or Payment Gateway Library (or both) to use the same version of the Components Library.
168161
3. **Contact Library Maintainers**: If you do not own the library yourself, reach out to the maintainers of the library projects. They may provide guidance, suggest workarounds, or release a version that addresses the conflict.
169162

163+
## Access Library Resources
164+
165+
Once the library is imported, following resources are accessible for use:
166+
167+
- [Components](../../resources/ui/components/intro-components.md)
168+
- [Data Types & Enums](../../resources/data-representation/custom-data-types.md)
169+
- [App State Variables](../../resources/data-representation/app-state.md)
170+
- [Constants](../../resources/data-representation/constants.md)
171+
- [API Calls](../../resources/control-flow/backend-logic/api/rest-api.md)
172+
- [Action Blocks](../../resources/control-flow/functions/action-blocks.md)
173+
- [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)
174+
- [Assets](../../resources/projects/settings/general-settings.md#app-assets) (Note: These are not versioned)
175+
176+
:::note
177+
Pages and Firestore Collections are still being worked on and may come in future updates.
178+
:::
179+
180+
It's important to note that these resources show up where they are instantiated. For example:
181+
182+
- **Components** appear in the widget palette.
183+
- **API calls** appear when making API calls in the action flow editor.
184+
- **Custom functions** are available when setting up actions or functions within the app.
185+
186+
This ensures that only relevant resources are shown where they are needed, optimizing performance and discoverability.
187+
188+
![access-library-resources.avif](imgs/access-library-resources.avif)
189+
190+
## Library Versioning
191+
Library versioning allows you to manage different versions of a library project over time. Using versioning, library users can control which version of a library to use in a project, ensuring compatibility and reducing the risk of breaking changes.
192+
193+
:::info[Importance of Library Versioning]
194+
- **Maintain Backward Compatibility**: It ensures older versions of the library continue to work as expected while introducing new features.
195+
- **Roll Back Changes**: In case of bugs or issues in a new version, you can easily revert to a previous stable version.
196+
- **Control Updates**: Library users can decide when to upgrade to the latest version, rather than being forced into changes.
197+
:::
198+
199+
### Publish New Version
200+
201+
When you're ready to update your library, ensure that all modifications are committed to the main branch of the library project and then publish as per instructions [here](#publishing-a-library).
202+
203+
:::tip
204+
205+
- While publishing a new version, add a description to highlight what's new or changed in this version.
206+
- Each time a new version is published, the version number will automatically increment.
207+
208+
:::
209+
210+
### Import Specific Version
211+
212+
When importing a library into a project, you have the flexibility to choose which version of the library to use. By default, the latest version will be selected.
213+
214+
![import-specific-library-version.avif](../imgs/import-specific-library-version.avif)
215+
216+
### Update to Latest Version
217+
218+
You can easily upgrade to newer versions of the libraries as they become available.
219+
220+
:::tip
221+
222+
- If a new update causes issues with your existing implementation, you also have the option to revert to a previous version.
223+
- Always test your app after upgrading to ensure that the new library version works well with your existing project.
224+
225+
:::
226+
227+
![update-library](imgs/update-library.avif)
170228

171229
## FAQs
172230

0 commit comments

Comments
 (0)