Best way to manage multiple "On Page Loads" actions triggered by multiple Menu Clicks

Actions & Logic

I have a menu where users can navigate between pages. Upon clicking a menu option, a callback is executed, and the user is directed to the desired page. Unfortunately, on each page, several actions are executed upon page load.

The issue arises when a user clicks a menu option multiple times, triggering all "On Page load" actions each time. For instance, I have a conditional that displays a bottom sheet on page load, depending on the situation. In such cases, if the user clicks three times, three bottom sheets are displayed consecutively.

What would be the best approach to handle situations like this?

What have you tried so far?

I realized this problem because of the bottom sheet situation. I tried to create a validation using an app state every time the bottom sheet shows, but if the user clicks fast, it still being a problem, because the navigate action from the menu is faster than the validations on page load actions.

Did you check FlutterFlow's Documentation for this topic?
Yes
3
7 replies