You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/resources/ui/pages/page-lifecycle.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,17 +108,17 @@ This action trigger allows you to bind keyboard shortcuts to actions. This is in
108
108
:::
109
109
110
110
:::info[important]
111
-
- When a keyboard shortcut is created at the page level, it won't trigger if a TextField is in focus, and you also won’t be able to type the shortcut key into the TextField.
112
-
- When a keyboard shortcut is created at the component level, it also won't trigger if a TextField is in focus, but you’ll still be able to type the shortcut key into the TextField.
111
+
- When a keyboard shortcut is created at the page level, it won't trigger if a TextField is in focus, and you also won't be able to type the shortcut key into the TextField.
112
+
- When a keyboard shortcut is created at the component level, it also won't trigger if a TextField is in focus, but you'll still be able to type the shortcut key into the TextField.
113
113
-**To avoid conflicts, it's recommended to use shortcuts that users are unlikely to type, such as Command + S, instead of a single key like 'S'.**
114
-
- There’s currently a known issue with Flutter's autofocus functionality. If a TextField inside a component has autofocus enabled, and the component has a keyboard shortcut, the TextField will not autofocus as expected.
114
+
- There's currently a known issue with Flutter's autofocus functionality. If a TextField inside a component has autofocus enabled, and the component has a keyboard shortcut, the TextField will not autofocus as expected.
115
115
:::
116
116
117
117
118
-
Implementing keyboard shortcuts is a straightforward process in FlutterFlow. You can define as many shortcuts as you want, each mapped to specific actions that will trigger when the corresponding key combination is pressed. Let’s see an example of an eCommerce web app where users can quickly access the cart page by pressing the `C` key.
118
+
Implementing keyboard shortcuts is a straightforward process in FlutterFlow. You can define as many shortcuts as you want, each mapped to specific actions that will trigger when the corresponding key combination is pressed. Let's see an example of an eCommerce web app where users can quickly access the cart page by pressing the `C` key.
119
119
120
120
121
-
To create a shortcut, use the **On Shorcut Press** action trigger, then type the keys that you want your app to listen for.
121
+
To create a shortcut, use the **On Shortcut Press** action trigger, then type the keys that you want your app to listen for.
122
122
123
123
<div style={{
124
124
position: 'relative',
@@ -146,12 +146,12 @@ To create a shortcut, use the **On Shorcut Press** action trigger, then type the
146
146
</div>
147
147
<p></p>
148
148
149
-
:::warning[Keyboard Shorcuts & Text Fields]
149
+
:::warning[Keyboard Shortcuts & Text Fields]
150
150
When implementing keyboard shortcuts on a page or component with a text field, you may need to ensure the text field ignores those shortcuts.
151
151
152
152
For instance, if you have a shortcut assigned to the letter "C" and a user tries to type "C" in the text field, you likely want the input to capture the keypress without triggering the shortcut.
153
153
154
-
To handle this, you can enable the option on the `TextField` widget to bypass keyboard shortcuts. However, it’s generally better to assign more unique combinations, like Cmd + C, which are less likely to conflict with normal typing in a text field.
154
+
To handle this, you can enable the option on the `TextField` widget to bypass keyboard shortcuts. However, it's generally better to assign more unique combinations, like Cmd + C, which are less likely to conflict with normal typing in a text field.
155
155
:::
156
156
157
157
### On Dispose [Action Trigger]
@@ -163,10 +163,10 @@ Imagine a scenario where [audio recording](../../../ff-concepts/file-handling/di
163
163
Additionally, if you are using a third-party package that relies on persistent connections or listeners, you can leverage [Custom Actions](../../../ff-concepts/adding-customization/custom-actions.md) with the On Dispose action trigger to close streams or cancel subscriptions.
164
164
165
165
:::tip[Possible Use Cases]
166
-
-**Cleaning Up Resources:**Use this action trigger to cancel timers, close database connections, or unsubscribe from streams to prevent memory leaks and unnecessary processing.
166
+
-**Cleaning Up Resources:**Use this action trigger to cancel timers, close database connections, or unsubscribe from streams to prevent memory leaks and unnecessary processing.
167
167
- For example, real-time applications, such as stock trading platforms, rely on WebSocket connections to fetch live updates. A homepage displaying a live ticker of stock prices would require opening the WebSocket connection on page load and closing it on On Dispose. Without an On Dispose trigger, the WebSocket connection could remain open unnecessarily, leading to wasted resources and app instability.
168
168
-**Finalizing Database Transactions**: Commit or roll back database transactions if the user leaves the page before completing the process.
169
-
-**Logging or Analytics:**Track user behavior or log events (e.g., page exit or time spent on a page) to monitor user engagement and improve the application experience.
169
+
-**Logging or Analytics:**Track user behavior or log events (e.g., page exit or time spent on a page) to monitor user engagement and improve the application experience.
0 commit comments