Skip to content

Commit ff068bb

Browse files
committed
Add Library Values
1 parent ec06481 commit ff068bb

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

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

Lines changed: 20 additions & 7 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

@@ -130,15 +130,15 @@ class _CustomButtonState extends State<CustomButton> {
130130
```
131131

132132

133-
### Manipulating AppState from Custom Code
133+
### Modifying AppState from Custom Code
134134

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 manipulate AppState variables. Let’s look at some examples:
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:
136136

137137
:::tip[Imports]
138138
Ensure you import `import '../../flutter_flow/flutter_flow_util.dart';` when accessing `FFAppState` in custom code resources.
139139
:::
140140

141-
- **Accessing AppState in Custom Code**
141+
- **Get AppState value in Custom Code**
142142

143143
```js
144144

@@ -217,7 +217,7 @@ final newProduct = ProductStruct(
217217

218218
```
219219

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

222222
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.
223223

@@ -229,7 +229,7 @@ This function retrieves and returns the product's name. The return type is `Stri
229229
```js
230230
// Function to return the product name from a ProductStruct instance
231231
String? getProductName(ProductStruct product) {
232-
// Access and return the product name
232+
// Get and return the product name
233233
return product.name;
234234
}
235235
```
@@ -345,3 +345,16 @@ Here’s a list of other Firebase Auth variables that can be referenced in Custo
345345
346346
- These variables make it easy to integrate Firebase Auth data into custom functionality, enhancing the user experience.
347347
348+
349+
### Get Library Values in Custom Code
350+
351+
Similar to the `FFAppState` class, FlutterFlow generates an `FFLibraryValues` class, which is also an abstract class. This class provides access to the **[Library Values](../../resources/projects/libraries.md#library-values)** if the project is a Library.
352+
353+
To directly access the Library Values in custom code:
354+
355+
```js
356+
Future getSchema(StateStruct? syncStatus) async {
357+
print(FFLibraryValues().schema);
358+
}
359+
```
360+

0 commit comments

Comments
 (0)