Skip to content

Commit c386e1a

Browse files
authored
Route Settings Generated Code (#256)
* Add page widget class info * Add references and correct info for page gen code doc. * Add diagrams for generated methods & classes for model class. * fix refs * fix refs * Add notes & gen code for route settings configurations. * Add notes & gen code for route settings configurations. * Add links
1 parent 8db1419 commit c386e1a

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

docs/generated-code/pages-generated-code.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ class _ProductListPageWidgetState extends State<ProductListPageWidget> {
120120
_model = createModel(context, () => ProductDetailPageModel());
121121

122122
}
123+
123124
```
124125
125126
#### PageModel Dispose
172 KB
Loading

docs/resources/ui/pages/pages-properties.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,40 @@ customize the URL paths for web and mobile deep linking, set meaningful Page
3333
Names as unique identifiers, integrate dynamic parameters into your routes, and
3434
set access restrictions based on user authentication.
3535

36+
![route-settings-configs.png](imgs/route-settings-configs.png)
37+
38+
**Skip On Page Load When Inactive**
39+
40+
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.
41+
42+
:::tip[Generated Code]
43+
When this check is enabled, the following code is added to your `initState` of your page:
44+
```js
45+
if (RootPageContext.isInactiveRootPage(context)) {
46+
return;
47+
}
48+
// On Page Load Actions added after this
49+
```
50+
:::
51+
52+
**Requires Authentication**
53+
54+
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.
55+
56+
:::tip[Generated Code]
57+
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**.
58+
59+
```js
60+
FFRoute(
61+
name: 'promotionPage',
62+
path: '/promotionPahe',
63+
requireAuth: true,
64+
builder: (context, params) => PromotionPageWidget(),
65+
)
66+
```
67+
:::
68+
69+
3670
:::info[LEARN MORE]
3771
Learn more about Routing [**here**](../../../ff-concepts/navigation-routing/nav-overview.md).
3872
:::
@@ -86,8 +120,8 @@ page, submit form data, or call an API. Actions are crucial for creating
86120
interactive and functional apps.
87121

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

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

0 commit comments

Comments
 (0)