Skip to content

Commit 6ea6474

Browse files
committed
Merge branch 'main' of https://github.com/FlutterFlow/flutterflow-documentation into rewrite/notifications
2 parents 7a1a0e9 + a0de31b commit 6ea6474

File tree

27 files changed

+297
-532
lines changed

27 files changed

+297
-532
lines changed

docs/ff-concepts/adding-customization/common-examples.md

Lines changed: 99 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import '/auth/firebase_auth/auth_util.dart';
3535
```
3636

3737
:::
38-
### Accessing FlutterFlow Generated Classes
38+
### Access FlutterFlow Generated Classes
3939

4040
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.
4141

@@ -78,7 +78,7 @@ When referencing a Component class in your code, FlutterFlow will automatically
7878
![return-widget-custom-code.png](imgs/return-widget-custom-code.png)
7979

8080

81-
### Accessing FlutterFlow Theme in Custom Widget
81+
### Get FlutterFlow Theme in Custom Widget
8282

8383
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.
8484

@@ -128,18 +128,17 @@ class _CustomButtonState extends State<CustomButton> {
128128
}
129129
}
130130
```
131-
:::info
132-
Find the list of colors,
133131

134-
### Manipulating AppState from Custom Code
135132

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:
137136

138137
:::tip[Imports]
139138
Ensure you import `import '../../flutter_flow/flutter_flow_util.dart';` when accessing `FFAppState` in custom code resources.
140139
:::
141140

142-
- **Accessing AppState in Custom Code**
141+
- **Get AppState value in Custom Code**
143142

144143
```js
145144

@@ -218,7 +217,7 @@ final newProduct = ProductStruct(
218217

219218
```
220219

221-
#### Example 2: Accessing Properties of an Existing `ProductStruct` object
220+
#### Example 2: Get Properties of an Existing `ProductStruct` object
222221

223222
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.
224223

@@ -230,7 +229,7 @@ This function retrieves and returns the product's name. The return type is `Stri
230229
```js
231230
// Function to return the product name from a ProductStruct instance
232231
String? getProductName(ProductStruct product) {
233-
// Access and return the product name
232+
// Get and return the product name
234233
return product.name;
235234
}
236235
```
@@ -346,3 +345,94 @@ Here’s a list of other Firebase Auth variables that can be referenced in Custo
346345
347346
- These variables make it easy to integrate Firebase Auth data into custom functionality, enhancing the user experience.
348347
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+
return FFDevEnvironmentValues().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
410+
411+
// Example Widget code
412+
class CustomDialog extends StatefulWidget {
413+
const CustomDialog({
414+
super.key,
415+
this.width,
416+
this.height,
417+
});
418+
419+
final double? width;
420+
final double? height;
421+
422+
@override
423+
State<CustomDialog> createState() => _CustomDialogState();
424+
}
425+
426+
class _CustomDialogState extends State<CustomDialog> {
427+
@override
428+
void initState() {
429+
library_hybw3o_actions.getSchema(StateStruct()); // calling library custom action
430+
super.initState();
431+
}
432+
@override
433+
Widget build(BuildContext context) {
434+
return Container(height: 50, width: 50);
435+
}
436+
}
437+
```
438+

docs/ff-concepts/adding-customization/custom-code.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ You can use the In-App Code Editor to view and edit custom code directly in the
4444

4545
![custom-code-common.png](imgs/custom-code-common.png)
4646

47+
:::tip
48+
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+
![open-in-vscode](imgs/open-in-vscode.avif)
51+
:::
52+
4753
:::warning[Using the In-App Code Editor on Desktop]
4854
Note that the desktop version of the In-App Code Editor is limited. We recommend using the Web editor
4955
or the **[VSCode Extension](vscode-extension.md)**.
Binary file not shown.

docs/ff-concepts/design-system/design-system.md

Lines changed: 9 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -45,61 +45,28 @@ To solve this issue, you can create a design system outlining common design guid
4545

4646

4747
## Adding Design System
48+
You can add a design system from the [Library](../../resources/projects/libraries.md) dependencies added to your project. A library can serve as a central repository for your design assets, components, and styles—effectively becoming a Design Library for your application(s).
4849

49-
To create your own design system:
50-
51-
1. Open the **Theme Settings > Design System**.
52-
2. Click **Create Design Library**.
53-
3. Enter the **Design Library Project Name**.
54-
4. Now you can configure the Colors, Typography & Icons, App Assets, NavBar & AppBar, and Theme Settings.
55-
5. To see how the app will look for the new design system, you can open it in preview mode (click the eye icon at the top right side).
56-
57-
<div style={{
58-
position: 'relative',
59-
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
60-
height: 0,
61-
width: '100%'}}>
62-
<iframe
63-
src="https://demo.arcade.software/7MfxqDLMHhtmen4DLo35?embed&show_copy_link=true"
64-
title="Sharing a Project with a User"
65-
style={{
66-
position: 'absolute',
67-
top: 0,
68-
left: 0,
69-
width: '100%',
70-
height: '100%',
71-
colorScheme: 'light'
72-
}}
73-
frameborder="0"
74-
loading="lazy"
75-
webkitAllowFullScreen
76-
mozAllowFullScreen
77-
allowFullScreen
78-
allow="clipboard-write">
79-
</iframe>
80-
</div>
81-
50+
:::tip[possible use cases]
8251

83-
<p></p>
52+
- **Enterprise Applications:** Large organizations can develop a centralized design system as a library to ensure all internal applications maintain a cohesive look and feel, enhancing brand identity and user experience.
53+
- **Startup MVPs:** Startups can expedite the development of Minimum Viable Products (MVPs) by leveraging a pre-built design system library like [**shadcn**](https://marketplace.flutterflow.io/item/cNlm0zWW1Nfq11cFXBmp), allowing them to focus on functionality and user validation.
54+
- **Cross-Platform Consistency:** Teams aiming to deploy apps across multiple platforms (iOS, Android, Web) can use a popular platform based design system library to ensure uniformity in design, reducing the effort required for platform-specific adjustments.
8455

85-
6. To use the design system, open your project and navigate to **Theme Settings > Design System**.
86-
7. Click on the **No Design System Selected**.
87-
8. A pop will open displaying the list of the design systems, click on the newly created design system to add it to your project. **Note** that the design system created in [My Organization](../../resources/projects/how-to-collaborate-on-projects.md#sharing-a-project-with-an-organization) will also be available here.
56+
:::
8857

89-
:::info
9058

91-
After selecting the design system, you can't change the Colors, Typography, and Theme Widgets.
59+
To add a design system from a library, start by creating the design system in a new FlutterFlow project and [publishing it as a library](../../resources/projects/libraries.md#publishing-a-library). Next, [import](../../resources/projects/libraries.md#importing-a-library) that library into the project where you want to use the design system. Then, navigate to **Theme Settings > Design System** and click **No Design System Selected**. From the dropdown that appears, **Select a library** you’ve just imported to apply its design system to your project.
9260

93-
:::
9461

9562
<div style={{
9663
position: 'relative',
9764
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
9865
height: 0,
9966
width: '100%'}}>
10067
<iframe
101-
src="https://demo.arcade.software/VW1EVzUHh70WhDEDz6n7?embed&show_copy_link=true"
102-
title="Sharing a Project with a User"
68+
src="https://demo.arcade.software/G3PekDcZNsWYrKoz3xnE?embed&show_copy_link=true"
69+
title=""
10370
style={{
10471
position: 'absolute',
10572
top: 0,
@@ -118,7 +85,6 @@ After selecting the design system, you can't change the Colors, Typography, and
11885
</div>
11986
<p></p>
12087

121-
---
12288

12389
## Import Figma Theme
12490

@@ -196,47 +162,6 @@ If you prefer watching a video tutorial, here is the guide for you:
196162
</div>
197163
<p></p>
198164

199-
## Use Library as Design System
200-
201-
You can also import a design system from the [Library](../../resources/projects/libraries.md) added to your project. A library can serve as a central repository for your design assets, components, and styles—effectively becoming a Design Library for your application(s).
202-
203-
:::tip[possible use cases]
204-
205-
- **Enterprise Applications:** Large organizations can develop a centralized design system as a library to ensure all internal applications maintain a cohesive look and feel, enhancing brand identity and user experience.
206-
- **Startup MVPs:** Startups can expedite the development of Minimum Viable Products (MVPs) by leveraging a pre-built design library like [**shadcn**](https://marketplace.flutterflow.io/item/cNlm0zWW1Nfq11cFXBmp), allowing them to focus on functionality and user validation.
207-
- **Cross-Platform Consistency:** Teams aiming to deploy apps across multiple platforms (iOS, Android, Web) can use a popular design system library to ensure uniformity in design, reducing the effort required for platform-specific adjustments.
208-
209-
:::
210-
211-
To add a design system from a library, first, ensure that you [add a library dependency to your project](../../resources/projects/libraries.md#importing-a-library). Then, navigate to **Theme Settings > Design System** and click on **No Design System Selected**. From the dropdown menu, **Select a library** you want to use.
212-
213-
214-
<div style={{
215-
position: 'relative',
216-
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
217-
height: 0,
218-
width: '100%'}}>
219-
<iframe
220-
src="https://demo.arcade.software/G3PekDcZNsWYrKoz3xnE?embed&show_copy_link=true"
221-
title=""
222-
style={{
223-
position: 'absolute',
224-
top: 0,
225-
left: 0,
226-
width: '100%',
227-
height: '100%',
228-
colorScheme: 'light'
229-
}}
230-
frameborder="0"
231-
loading="lazy"
232-
webkitAllowFullScreen
233-
mozAllowFullScreen
234-
allowFullScreen
235-
allow="clipboard-write">
236-
</iframe>
237-
</div>
238-
<p></p>
239-
240165
---
241166

242167
## Loading Indicators

docs/ff-integrations/firebase/connect-to-firebase-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Cloud Functions Admin permissions are required for several FlutterFlow features
8989

9090
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.
9191

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**.
9393

9494
:::info
9595
Do not close or refresh the page while the files are being generated.

0 commit comments

Comments
 (0)