Skip to content

Add Rebuild Action #451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
9 changes: 9 additions & 0 deletions docs/ff-concepts/state-management/state-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,14 @@ You can learn more about state management from this video:
:::


## Rebuild [Action]

The **Rebuild** action allows you to refresh a page or a component’s UI. This is especially useful when data changes dynamically; for example, after an API call, a database update, a custom action, or a class method modifies the internal state, and you want the latest data or UI state to be reflected instantly.

The Rebuild action provides different update types depending on where it is used:

- **Rebuild Page:** When on a page, you will see the **Rebuild Current Page** option, which refreshes the entire page’s UI.
- **Rebuild Component:** When on a component, you will see the **Rebuild Current Component** option, which refreshes only that specific component.
- **Rebuild Containing Page:** When on a component, you will see this option as well, which refreshes the entire page that contains the component. For example, if you have a **"Confirm"** button inside a dialog component that updates an order’s status, selecting this action will refresh the parent page to instantly show the updated order list.

![rebuild](imgs/rebuild.avif)
4 changes: 4 additions & 0 deletions docs/resources/data-representation/app-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ Here's a quick guide to updating the app state variable. We need to add an actio
</iframe>
</div>

:::tip
If you want to rebuild a page or component without updating any state variables, use the [**Rebuild**](../../ff-concepts/state-management/state-variables.md#rebuild-action) state action.
:::

## FAQs

<details>
Expand Down
4 changes: 4 additions & 0 deletions docs/resources/ui/components/component-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ Type** property in your Action properties. Here's what it means:
- **No Rebuild:** Choose this option when you need to update the state value without
immediately reflecting the changes in the UI.

:::tip
If you want to rebuild a component without updating any state variables, use the [**Rebuild**](../../../ff-concepts/state-management/state-variables.md#rebuild-action) state action.
:::

:::warning[Expensive Rebuilds]
Too many rebuilds can impact performance because rebuilding the widget tree
frequently consumes resources and may lead to decreased responsiveness and
Expand Down
6 changes: 5 additions & 1 deletion docs/resources/ui/pages/page-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,17 @@ update, create a new Action called **Update Page State**.
When updating your page state in Flutter, you'll often come across the **Update
Type** property in your Action properties. Here's what it means:

**Rebuild Current Type:** This option triggers a re-rendering of the page,
**Rebuild Current Page:** This option triggers a re-rendering of the page,
ensuring
that any changes to the state are reflected in the user interface (UI).

**No Rebuild:** Choose this option when you need to update the state without
immediately reflecting the changes in the UI.

:::tip
If you want to rebuild a page without updating any state variables, use the [**Rebuild**](../../../ff-concepts/state-management/state-variables.md#rebuild-action) state action.
:::

:::warning[Expensive Rebuilds]
Too many rebuilds can impact performance because rebuilding the widget tree
frequently consumes resources and may lead to decreased responsiveness and
Expand Down