FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
125 stars 25 forks source link

Am unable to execute a callback action on a component #3734

Closed SpencerHaven closed 1 month ago

SpencerHaven commented 2 months ago

Can we access your project?

Current Behavior

I followed this flutterflow tutorial on components to the T and cannot get the action to work on a component: https://www.youtube.com/watch?v=EiHY5WP_pDk

On the component, I add an action parameter. Then, on the component itself I set the action to on tap -> execute callback and bind the "action" parameter to it. Lastly, on the page I have the component added to, I set the component properties to navigate to another page. When I go to test this out nothing happens. I've looked over it several times and am at a loss.

Expected Behavior

I would expect that, once I have the action on the component set up, when I pass the action to it, it should perform that action. In this case, navigating to another page.

Steps to Reproduce

  1. Create a component
  2. Add component Parameter
  3. Set type to action
  4. Select component and define action to on tap execute callback and set callback to the parameter previously added
  5. Add component to page
  6. Pass data to component and set action to navigate to a page
  7. Select Preview
  8. Select component
  9. Nothing happens

Reproducible from Blank

Bug Report Code (Required)

ITESz/Hqx89gocdc+s72cMJqhQMkQzM6bZI7ku1EdwEhNYD3PYkiZOP8QFVLYteDY35iJVaYgXMJpcGPi+GTUfcnHxyVQLlyyoRXQQz/QlqhVrKJCs67e398TMVRGmKn08O3hRVQPvZfSGQ460yEIvCdG3qCf9qOYwx5e6fDbOY=

Visual documentation

Screenshot 2024-09-01 at 8 55 28 PM Screenshot 2024-09-01 at 8 55 09 PM Screenshot 2024-09-01 at 8 54 42 PM Screenshot 2024-09-01 at 8 53 51 PM

Environment

- FlutterFlow version: 4.1.85
- Platform: MacOS Web
- Browser name and version: Chrome, 128
- Operating system and version affected: macOS Sonoma 14.6.1

Additional Information

I'm trying to create a reusable component. Since I cannot use the component to navigate, it is essentially useless to me. If I want to make changes to this widget, I can't do it in one spot, which will just take more time.

Alezanello commented 2 months ago

Hello!

Thank you for reaching out!
It looks like you were testing the app in Preview Mode to check the actions, but I'd like to clarify that Preview Mode is primarily designed to display the UI and data without building the full app.

Some action callbacks or features may not function as expected because the app hasn't been fully compiled—it's more of a UI view.

To properly test the actions and behaviors you're working on, I recommend using Test Mode or Run Mode, which offer a more accurate reflection of the app's functionality. Alternatively, you can use our Desktop Apps for a local run or download the code to run it locally.

For more details, you can refer to the Preview Mode documentation. Right below that section, you'll find helpful documentation on Test/Run Mode and Local Run for deeper testing.

If you need further assistance, feel free to ask!

Best regards,
Azanello

Alezanello commented 2 months ago

On another note, I just tested your project and confirmed that you’ve successfully implemented the Action Callback in the component. Great job, congratulations!

component button.gif
github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

Alezanello commented 1 month ago

Closing this issue since we haven't heard back from you. If you are still facing the problem please submit a new issue. Have a great day!