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
[Cloud Functions](https://firebase.google.com/docs/functions) allows you to run backend code in response to events triggered by Firebase features and HTTPS requests. For example, you want to automatically send a welcome email to users when they sign up for your app. You can do this using a Cloud Function that triggers on Firebase Authentication's user creation event.
12
+
[**Cloud Functions**](https://firebase.google.com/docs/functions) allows you to run backend code in response to events triggered by Firebase features and HTTPS requests. For example, you want to automatically send a welcome email to users when they sign up for your app. You can do this using a Cloud Function that triggers on Firebase Authentication's user creation event.
13
13
14
14
We allow you to write and deploy Firebase Cloud Functions directly within the platform. With an integrated code editor, writing JavaScript cloud functions is quick and user-friendly. Each function has customizable boilerplate settings, including pre-configured essentials like memory, region, and timeout.
15
15
16
16
:::note
17
-
You can find some interesting use cases [*here*](https://firebase.google.com/docs/functions/use-cases).
@@ -50,6 +52,8 @@ For this example, you'll need to set up two [page state variables](/data-and-bac
50
52
1.**generatingImage (*****Type: Boolean*****)**: This is used to control the visibility of a
51
53
loading indicator during the logo creation process. Its value is set to *True* before initiating the API call and switched to *False* once the logo generation is complete.
52
54
5.**logoImage (*****Type: ImagePath*****)**: This is used to hold the generated logo image. After a successful API call, the retrieved image URL is stored here, allowing the logo to be displayed in the Image widget.
55
+
56
+
<p></p>
53
57

54
58
55
59
### 2. Build a page
@@ -69,16 +73,18 @@ Few things to note here:
69
73
70
74
To create and deploy a *Cloud Function* :
71
75
72
-
1. Click on the **Cloud Functions** from the [*Navigation Menu*]
73
-
(/getting-started/ui-builder/navigation-menu) (left side of your screen).
74
-
5. Click **+ Add**. This will add the default newCloudFunction*.*
76
+
1. Click on the **Cloud Functions** from the
77
+
[**Navigation Menu**](../../../docs/intro/ff-ui/builder.md#navigation-menu) (left side of your
78
+
screen).
79
+
5. Click **+ Add**. This will add the default `newCloudFunction`.
75
80
8. Set the **Cloud Function Name**.
76
81
77
82
#### Boilerplate Settings
78
83
79
84
On the right side, you can configure the following Boilerplate Settings:
80
85
1.**Memory Allocation**: You can specify the amount of memory your function should have when
81
86
it's executed based on its complexity and needs. This setting is crucial as it influences the function's performance and the cost of running it. More memory can enhance performance for intensive tasks but also increase costs.
87
+
82
88
5.**Timeout (s)**: This refers to the maximum amount of time, in seconds, that a function is allowed to run before it is automatically terminated. If your function takes longer to execute, increasing the timeout setting may be necessary. However, be aware that longer timeouts can incur higher costs since billing is based on execution time.
83
89
8.**Require Authentication**: Turn on this setting if you want users to be authenticated to execute this cloud function.
84
90
11.**Cloud Function Region**: This determines the geographical location of the servers where your functions are hosted and executed. Ideally, you should keep this same as your *Default GCP resource location* and the Cloud Function Region specified in the Firebase Advanced Settings.
@@ -92,6 +98,7 @@ by configuring the input and output.
92
98
93
99
1. To receive output from a Cloud Function, enable the **Return Value** and choose an
94
100
appropriate Type for the output, like 'String' for text. For this example, set it to *ImagePath* to get the URL of the generated logo.
101
+
95
102
5. To input data: Click **+ Add parameters**. **Name** the parameter, select its **Type**, choose single or multiple items (**Is List** option), and uncheck **Nullable** if the value can be null. For this example, add a parameter 'prompt' with *Type* set to *String*.
96
103
8. When using [Custom Data Types](/data-and-backend/custom-data-types), Cloud Function expects JSON, matching each field in the Data Type to a key-value pair in the JSON. If the Data Type is a list, the function expects a list of JSONs. For example, for a custom data type named 'Person' with fields 'Name' and 'Age,' the function should return:
97
104
@@ -125,6 +132,7 @@ For a list, the function should return:
125
132
#### To deploy
126
133
1. Click the `[</>]` icon to view the boilerplate code; a popup will open with the updated
127
134
code, and then click **`</> Copy to Editor`**. **Tip**: To see if you are able to deploy the cloud function (before adding your own code), proceed directly with steps 8 and 9.
135
+
128
136
2. Inside the code editor, add the cloud function code. **Tip**: You can copy the boilerplate code
129
137
to [ChatGPT](https://chat.openai.com/) and ask it to write the desired code based on that.
2. Now click on **Custom Functions** from the [*Navigation Menu*](/getting-started/ui-builder/navigation-menu) (left side of your screen) and open the **Custom Files > main.dart**.
69
+
2. Now click on **Custom Functions** from the
70
+
[**Navigation Menu**](../../../docs/intro/ff-ui/builder.md#navigation-menu) and open the **Custom Files > main.dart**.
70
71
5. Determine where to place the code (i.e., **Initial Action** or **Final Action**), click the **+** button, and select the custom action.
Copy file name to clipboardExpand all lines: docs/ff-concepts/state-management/state-management.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: State Management
3
3
description: An overview of state management in FlutterFlow
4
4
---
5
5
6
-
State management is a crucial concept focused on maintaining and controlling the *state* of an application. Simply put, it involves monitoring the changes within your app and updating the user interface to reflect these changes.
6
+
State management is a crucial concept focused on maintaining and controlling the **state** of an application. Simply put, it involves monitoring the changes within your app and updating the user interface to reflect these changes.
7
7
8
8
You can think of the UI as a function of your state variables, where changes in these variables directly influence what the UI displays.
9
9
@@ -28,8 +28,10 @@ You can learn more about state management from this video:
28
28
<p></p>
29
29
30
30
:::tip
31
-
To learn more about state management in FlutterFlow, read up on [**Variables**](#) and how [**Page
32
-
State**](#), or
31
+
To learn more about state management in FlutterFlow, read up on
32
+
[**Variables**](../../resources/data-representation/overview.md#variable) and how
33
+
[**Page
34
+
State**](../../resources/ui-building-blocks/pages/page-lifecycle.md#page-state), or
33
35
[**Component State**](#) or [**App State variables**](#) are modified in FlutterFlow.
2. Complete [**Initial setup**](auth-initial-setup) required for authentication.
54
54
3. Created an [**Apple account**](https://appleid.apple.com/account?appId=632&returnUrl=https%3A%2F%2Fdeveloper.apple.com%2Faccount%2F).
55
-
4.[**Purchased an Apple Developer membership**](https://developer.apple.com/programs/enroll/). Please see [**this link**](https://developer.apple.com/programs/) for more details on the Apple Developer program and how to sign up.
56
-
5. Apple sign-In can not be tested in Run Mode. You will need to test it on a real device or emulator.
55
+
4.[**Purchased an Apple Developer membership**](https://developer.apple.com/programs/enroll/).
56
+
Read more about the [**Apple Developer Program**](https://developer.apple.com/programs/) and how to sign up.
57
+
5. Apple sign-In can not be tested in Run Mode. You will need to test it on a real device or
0 commit comments