You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FlutterFlow generates a complete Flutter codebase for you as you build apps in its platform. Part of this code includes custom classes that are designed to streamline common tasks and encapsulate reusable properties or logic.
41
41
@@ -78,7 +78,7 @@ When referencing a Component class in your code, FlutterFlow will automatically
When building custom widgets, you often need to style parts of the widget, such as setting colors. Instead of using hardcoded color values, you can directly access the **FlutterFlow Theme**. This theme provides consistent styling across your app and reflects colors set by you or your project developer.
84
84
@@ -128,18 +128,17 @@ class _CustomButtonState extends State<CustomButton> {
128
128
}
129
129
}
130
130
```
131
-
:::info
132
-
Find the list of colors,
133
131
134
-
### Manipulating AppState from Custom Code
135
132
136
-
In FlutterFlow, you can access or update AppState directly from the Action Flow Editor. However, certain scenarios may require you to access or modify AppState within custom code for more control over the operation flow. The FFAppState class also provides additional helper functions to manipulate AppState variables. Let’s look at some examples:
133
+
### Modifying AppState from Custom Code
134
+
135
+
In FlutterFlow, you can access or update AppState directly from the Action Flow Editor. However, certain scenarios may require you to access or modify AppState within custom code for more control over the operation flow. The `FFAppState` class also provides additional helper functions to modify AppState values. Let’s look at some examples:
137
136
138
137
:::tip[Imports]
139
138
Ensure you import `import '../../flutter_flow/flutter_flow_util.dart';` when accessing `FFAppState` in custom code resources.
140
139
:::
141
140
142
-
-**Accessing AppState in Custom Code**
141
+
-**Get AppState value in Custom Code**
143
142
144
143
```js
145
144
@@ -218,7 +217,7 @@ final newProduct = ProductStruct(
218
217
219
218
```
220
219
221
-
#### Example 2: Accessing Properties of an Existing `ProductStruct` object
220
+
#### Example 2: Get Properties of an Existing `ProductStruct` object
222
221
223
222
If you have an existing `ProductStruct` object (e.g., retrieved from a list of products), you can access its properties or return specific values back to the calling Action.
224
223
@@ -230,7 +229,7 @@ This function retrieves and returns the product's name. The return type is `Stri
230
229
```js
231
230
// Function to return the product name from a ProductStruct instance
232
231
String?getProductName(ProductStructproduct) {
233
-
//Access and return the product name
232
+
//Get and return the product name
234
233
returnproduct.name;
235
234
}
236
235
```
@@ -346,3 +345,94 @@ Here’s a list of other Firebase Auth variables that can be referenced in Custo
346
345
347
346
- These variables make it easy to integrate Firebase Auth data into custom functionality, enhancing the user experience.
348
347
348
+
349
+
### Get Dev Environment Values in Custom Code
350
+
351
+
Similar to `FFAppState`, FlutterFlow generates a singleton `FFDevEnvironmentValues` class in your FlutterFlow generated codebase, if you are using **[Dev Environments](../../testing-deployment-publishing/development-environments/development-environments.md)**. This class can also be accessed from custom code if needed. It is generated based on the environment selected by the user at the time of code generation.
352
+
353
+
To access any Dev Environment values in custom code, simply use:
354
+
355
+
```js
356
+
Future getWebhookId() async {
357
+
// Add your function code here!
358
+
returnFFDevEnvironmentValues().webhookId;
359
+
}
360
+
```
361
+
362
+
### Access Library Components in Custom Code
363
+
364
+
When using a library dependency in your project, you can also access its components, such as Library App State, Library Values, and Library Widgets, in the user project's custom code. Here are a few examples:
365
+
366
+
#### Get Library Values
367
+
368
+
Similar to `FFAppState` or `FFDevEnvironmentValues` class, FlutterFlow generates a singleton `FFLibraryValues` class for library projects, which provides direct access to **[Library Values](../../resources/projects/libraries.md#library-values)**.
369
+
370
+
To access Library Values directly in custom code:
371
+
372
+
```js
373
+
Future getSchema(StateStruct? syncStatus) async {
374
+
print(FFLibraryValues().schema);
375
+
}
376
+
```
377
+
378
+
#### Get Library Custom Code
379
+
380
+
When you add a library dependency to your FlutterFlow project, FlutterFlow automatically includes necessary imports, allowing you to utilize custom code resources from the library project in your user project's custom code files.
381
+
382
+
For example, if you have a library with project ID `library_hybw3o`, FlutterFlow will add the following import to your project:
383
+
384
+
```js
385
+
import'package:library_hybw3o/flutter_flow/custom_functions.dart' as library_hybw3o_functions;
386
+
```
387
+
388
+
389
+
Now, let's use the library’s custom functions in the user project's custom function:
390
+
391
+
```js
392
+
int getRandomIndex(List<int>indexList) {
393
+
final item =library_hybw3o_functions.getRandomItem(); // Library's custom function
394
+
// get Random Index
395
+
final randomNumber =math.Random();
396
+
return...
397
+
}
398
+
```
399
+
400
+
#### Manually Add Library Imports
401
+
If the library import doesn’t appear in your project automatically, you can manually add it and assign a custom alias. For example, to import a library’s custom actions into your project’s Custom Widget resource, add the import yourself as shown below:
402
+
403
+
For example, let's import the library's custom actions into the user project's Custom Widget resource.
404
+
405
+
If the import is not already available, you can add it manually as follows:
406
+
407
+
```js
408
+
// Custom import
409
+
import'package:library_hybw3o/custom_code/actions/index.dart' as library_hybw3o_actions; // Assigning a custom alias to the import
To leverage the capabilities that go beyond our in-app code editor, you can click on the **VS Code icon** to open and edit your custom code directly in VS Code using the FlutterFlow [**VSCode extension**](vscode-extension.md).
49
+
50
+

51
+
:::
52
+
47
53
:::warning[Using the In-App Code Editor on Desktop]
48
54
Note that the desktop version of the In-App Code Editor is limited. We recommend using the Web editor
49
55
or the **[VSCode Extension](vscode-extension.md)**.
Copy file name to clipboardExpand all lines: docs/ff-integrations/firebase/connect-to-firebase-setup.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ Cloud Functions Admin permissions are required for several FlutterFlow features
89
89
90
90
3. Return to FlutterFlow, enter your Firebase Project ID in the dialog, and click Connect. A green checkmark will appear once the connection is successful.
91
91
92
-
4. Under Config Files, choose **Autogenerate Files** and then select **Generate Files**.
92
+
4. Under Config Files, choose **Generate Config Files** and then select **Generate Files**.
93
93
94
94
:::info
95
95
Do not close or refresh the page while the files are being generated.
Copy file name to clipboardExpand all lines: docs/intro/ff-ui/toolbar.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -263,6 +263,8 @@ The Developer Menu provides developers with access to tools such as code viewing
263
263
_Connect GitHub Repo_, _Download Code_, and _Download APK_ features requires a [**paid plan**](https://flutterflow.io/pricing).
264
264
:::
265
265
266
+
6.**Open in VSCode**: This option lets you open your entire FlutterFlow project in a VS Code environment, offering a richer development experience. You’ll have real-time autocomplete and error detection, easier access to existing Flutter & Dart tooling, and the ability to leverage the AI ecosystem.
267
+
266
268
## Share project
267
269
268
270
You can make a project public so that others can view and clone your project. Before you share your project, make sure to remove any sensitive information.
Copy file name to clipboardExpand all lines: docs/marketplace/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ FlutterFlow's Marketplace is a dynamic platform designed to enhance your app dev
14
14
In the FlutterFlow Marketplace, you can [add and purchase](adding-purchasing-item.md) items to quickly integrate into your projects, significantly reducing development time. The Marketplace is curated to ensure high-quality resources, with contributions from a diverse community of developers and designers.
15
15
16
16
## Becoming a Contributor
17
-
If you're interested in contributing to the Marketplace, the [creator hub](creators-hub/creators-hub.md) is your starting point. Here, you can learn about [submitting items for review](creators-hub/submit-item-for-reivew.md), [submission criteria](creators-hub/submission-criteria.md), and [legal guidelines](creators-hub/legal-guidelines-for-creators.md) for creators. Ensuring your submissions adhere to these guidelines helps maintain the quality and integrity of the Marketplace.
17
+
If you're interested in contributing to the Marketplace, the [creator hub](creators-hub/creators-hub.md) is your starting point. Here, you can learn about [submitting items for review](creators-hub/submit-item-for-review.md), [submission criteria](creators-hub/submission-criteria.md), and [legal guidelines](creators-hub/legal-guidelines-for-creators.md) for creators. Ensuring your submissions adhere to these guidelines helps maintain the quality and integrity of the Marketplace.
18
18
19
19
## Protecting Your Work
20
20
Understanding and navigating [copyright (DMCA process)](creators-hub/copyright-dmca-process.md) is crucial for both creators and users. The Marketplace provides clear instructions on how to handle copyright issues, ensuring that intellectual property rights are respected.
Copy file name to clipboardExpand all lines: docs/resources/data-representation/global-properties.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ A list of all the available global properties is as follows:
31
31
32
32
-**Current Time**: Fetches the current date and time. Explore [custom formatting](#current-time) options to tailor the DateTime display to your needs.
33
33
34
-
-**Current Device Location:**Obtains he user's current location, ideal for updating their position on Google Maps or storing it in a backend database. [Check out examples](#current-device-location) on how to retrieve and save the current device location.
34
+
-**Current Device Location:**Returns the user's current location, ideal for updating their position on Google Maps or storing it in a backend database. [Check out examples](#current-device-location) on how to retrieve and save the current device location.
35
35
36
36
-**Current Route Path**: Provides the route name of the currently active or visible page in your app. This property is especially helpful in scenarios where you want to adjust or block specific actions if the active page isn't the one you expect. For example, if you launch the app through a push notification, the home page might still run in the background, even if the notification directs you to a different page. Using this property, you can prevent unnecessary action triggers, such as On Page Load from the home page. See details on avoiding [this issue](https://github.com/FlutterFlow/flutterflow-issues/issues/2765#issuecomment-2598915946).
37
37
-**Fraction of Screen Width:** Determines the proportional width of the device's screen.
@@ -45,7 +45,7 @@ A list of all the available global properties is as follows:
45
45
-**Is Dark Mode:** Checks if the app's current theme mode is set to dark.
46
46
-**Is Light Mode:** Checks if the app's current theme mode is set to light.
47
47
-**Is On-Screen Keyboard Visible:** Checks if the on-screen or soft keyboard is visible. This is helpful in making UI adjustments if keyboard is visible on screen. See a [quick example](#is-on-screen-keyboard-visible).
48
-
-**Current Environment**: Gives you the current [development environment](../../testing-deployment-publishing/development-environments/development-environments.md) value.
48
+
-**Current Environment**: Returns the current [development environment](../../testing-deployment-publishing/development-environments/development-environments.md) value.
49
49
50
50
:::tip[Generated Code]
51
51
Learn more about the [**Generated Code**](../../generated-code/state-mgmt-gen-code.md#global-state) behind Global Properties.
Copy file name to clipboardExpand all lines: docs/resources/projects/libraries.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -202,6 +202,10 @@ It's important to note that these resources show up where they are instantiated.
202
202
203
203
This ensures that only relevant resources are shown where they are needed, optimizing performance and discoverability.
204
204
205
+
:::tip[Access Library Components in Custom Code]
206
+
When your project includes a library dependency, you can use its components—such as Library App State, Library Values, Library Custom Code resources, etc.—in your custom code. Explore the **[Common Custom Code Examples](../../ff-concepts/adding-customization/common-examples.md#access-library-components-in-custom-code)** directory for reference.
0 commit comments