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
@@ -57,11 +58,12 @@ You can create and switch environments in the **Dev Environments** page in **App
57
58
The selected environment is used to generate the proper app code when you run, test, deploy or export your app. The only things that change between environment are the [Firebase Project](#configuring-firebase-or-supabase-for-each-environment) or variables that are tied to [Environment Values](#use-environment-values)
58
59
59
60
60
-
### Use Environment Values
61
+
### Environment Values
61
62
Environment Values can be used to dynamically change parts of your app's code based on the environment that is being used.
62
63
63
64
For example, in an e-commerce app, you might define an `apiUrl` Environment Value that points to different API URLs for Development, Staging, and Production. This allows you to test new features without affecting the live production environment, where real customer orders are processed.
64
65
66
+
#### Use Environment Value
65
67
Let's see an example of creating and using `apiUrl`:
66
68
67
69
<div style={{
@@ -90,16 +92,32 @@ Let's see an example of creating and using `apiUrl`:
90
92
</div>
91
93
<p></p>
92
94
93
-
:::info
94
-
After switching to an environment, FlutterFlow generates code specific to that environment, for any of the following interactions:
95
+
:::tip[Generated Code]
96
+
When you switch to an environment, FlutterFlow generates code specific to that environment, for any of the following interactions:
95
97
- Test / Run mode sessions
96
98
- Local Run
97
99
- Code export
98
100
- Deployment
99
101
100
-
You also may see different project errors depending on which environment you have selected.
102
+
You may also encounter different project errors depending on the selected environment.
103
+
104
+
In the generated code, FlutterFlow creates two files:
105
+
106
+
-`environment.json` – Stores the environment values defined by the user in FlutterFlow.
107
+
-`FFDevEnvironmentValues` class – A singleton class that holds a single instance of the `FFDevEnvironmentValues` object. It includes initialization logic and getters for accessing these environment values. They can also be referenced in your custom code resources. See **[Common Custom Code Examples](../../ff-concepts/adding-customization/common-examples.md)**.
101
108
:::
102
109
110
+
#### Private Environment Values
111
+
112
+
You can mark environment values as private when they contain sensitive information that should not be exposed in the client-side code. **Private** environment values are not included in the generated code.
113
+
114
+
Currently, the only way to use a private environment value is as a variable in a private API call. Since private API calls are routed through a Cloud Function, the variable value remains hidden from any client-side requests made by the app.
115
+
116
+
:::tip[Generated Code]
117
+
For private environment values, the generated code does not include these values in the `environment.json` file, and no getter logic is created in the `FFDevEnvironmentValues` class.
118
+
:::
119
+
120
+
103
121
### Configuring Firebase or Supabase for each Environment
104
122
A single FlutterFlow project can have **multiple environments**, each mapped to its **own Firebase or Supabase project**. This ensures that environments like `Development`, `Staging`, and `Production` remain independent, giving you better control over your app's data and behavior throughout different stages of development.
105
123
@@ -159,6 +177,8 @@ It's recommended that you keep schemas consistent between the different Supabase
0 commit comments