Skip to content

Route Settings Generated Code #256

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 13 commits into from
Jan 23, 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
1 change: 1 addition & 0 deletions docs/generated-code/pages-generated-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class _ProductListPageWidgetState extends State<ProductListPageWidget> {
_model = createModel(context, () => ProductDetailPageModel());

}

```

#### PageModel Dispose
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 36 additions & 2 deletions docs/resources/ui/pages/pages-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,40 @@ customize the URL paths for web and mobile deep linking, set meaningful Page
Names as unique identifiers, integrate dynamic parameters into your routes, and
set access restrictions based on user authentication.

![route-settings-configs.png](imgs/route-settings-configs.png)

**Skip On Page Load When Inactive**

Ensures that actions are bypassed if the Entry Page or Logged In Page is detected as inactive. This is designed specifically for entry points in the app to prevent unnecessary operations when the page is not fully active, optimizing performance and avoiding redundant executions.

:::tip[Generated Code]
When this check is enabled, the following code is added to your `initState` of your page:
```js
if (RootPageContext.isInactiveRootPage(context)) {
return;
}
// On Page Load Actions added after this
```
:::

**Requires Authentication**

When the "Requires Authentication" option is enabled for a page, it ensures that only users who are logged in can access that page. This setting is particularly useful for protecting sensitive or personalized content, as it prevents unauthorized users from viewing or interacting with the page.

:::tip[Generated Code]
When the Route object is created for this Page, setting `requireAuth: true` ensures that only authenticated users can access this page. If "Requires Authentication" is checked, the app will automatically enforce authentication checks before navigating to this page. This is automatically enabled for **Logged In Page**.

```js
FFRoute(
name: 'promotionPage',
path: '/promotionPahe',
requireAuth: true,
builder: (context, params) => PromotionPageWidget(),
)
```
:::


:::info[LEARN MORE]
Learn more about Routing [**here**](../../../ff-concepts/navigation-routing/nav-overview.md).
:::
Expand Down Expand Up @@ -86,8 +120,8 @@ page, submit form data, or call an API. Actions are crucial for creating
interactive and functional apps.

In the case of Scaffold (Page) actions, you can establish specific behaviors or
functions that are triggered by certain events related to the page's lifecycle such as **On Page
Load** or **On Phone Shake**.
functions that are triggered by certain events related to the page's lifecycle such as [**On Page
Load**](page-lifecycle.md#on-page-load-action-trigger) or [**On Phone Shake**](page-lifecycle.md#on-phone-shake-action-trigger).

:::info[LEARN MORE]
To learn about the page lifecycle and other methods exposed by FlutterFlow, [**refer to this resource**](page-lifecycle.md).
Expand Down
Loading