Skip to content

Commit 16ff158

Browse files
authored
Merge pull request #350 from tirth-patel-nc/patch-2
docs: fix formatting
2 parents a628020 + 104907f commit 16ff158

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

docs/generated-code/ff-app-state.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,14 @@ class FFAppState extends ChangeNotifier {
3434
notifyListeners();
3535
}
3636

37-
// App State variable of primitive type with a getter and setter
38-
bool _enableDarkMode = false;
37+
// App State variable of primitive type with a getter and setter
38+
bool _enableDarkMode = false;
3939

40-
bool get enableDarkMode => _enableDarkMode;
40+
bool get enableDarkMode => _enableDarkMode;
4141

42-
set enableDarkMode(bool value) {
42+
set enableDarkMode(bool value) {
4343
_enableDarkMode = value;
44-
}
45-
44+
}
4645
}
4746
```
4847

@@ -52,7 +51,7 @@ The `_enableDarkMode` is an App State variable created by developer that creates
5251
When updating an `AppState` variable from the Action Flow Editor, you will be presented with several **[update type](../resources/data-representation/app-state.md#update-type)** options such as **Rebuild All Pages**, **Rebuild Current Page**, and **No Rebuild** in the Action Settings. Let's see how the generated code changes when these options are selected.
5352

5453
### Rebuild Current Page
55-
When a developer chooses to update App State with the update type set to **Rebuild Current Page**, the corresponding `setter` is called. Immediately after, `setState((){});` is invoked, which updates only the current page.
54+
When a developer chooses to update App State with the update type set to **Rebuild Current Page**, the corresponding `setter` is called. Immediately after, `setState(() {});` is invoked, which updates only the current page.
5655

5756
Here's an example of the generated code when we update the App State `enableDarkMode` in the `onInitialization` action trigger of the `ProductListPage`.
5857

@@ -90,7 +89,7 @@ Only the setter is called with no setState or update method invoked afterward. T
9089
When you add an [**Update App State**](../resources/data-representation/app-state.md#update-app-state-action) action via the Action Flow Editor, the corresponding pages will include this line within the build method:
9190
9291
```js
93-
@override
92+
@override
9493
Widget build(BuildContext context) {
9594
context.watch<FFAppState>();
9695
...
@@ -155,4 +154,4 @@ These functions are automatically generated to provide a convenient and consiste
155154
156155
:::info[How to create App State variables]
157156
To learn more about creating and using App State variables in FlutterFlow's UI, check out the[ **App State**](../resources/data-representation/app-state.md) guide.
158-
:::
157+
:::

0 commit comments

Comments
 (0)