Abhishek Balani
 · Founder at SuprFollow.com & SuprLabs.io

How to execute nested callbacks - chained action parameters

Actions & Logic

Hi guys,

I have a comments page where user can open an overflow menu to open a delete confirmation dialog to delete the comment. It goes like

Comments page > Dialog 1 > Dialog 2

I want to refresh the comments list once the comment is deleted. I was trying to do this with executing chained callbacks. I am passing action parameter from comments list page to custom dialog component 1 and then an action parameter from dialog 1 to dialog 2.

This is the flow:

Page 1 (comments page):

  • Passed refreshCommentsAction when opening the Dialog 1 component

  • Defined refreshCommentsAction - API to refresh comments

Page 2 - Dialog 1:

  • Declared action parameter - refreshCommentsAction

  • Passed childAction when opening next component

  • Need to define what will happen in childAction .

  • Ideally I want to execute callback to call refreshCommentsAction. But not able to fine refreshCommentsAction in execute callback of childAction. THIS IS THE ISSUE.

Page 3 - Dialog 2:

  • Declared action parameter - childAction

  • On Delete API success, execute callback and call childAction so that execution control goes to previous component.

Please let me know if you have executed callbacks where action parameters are chained

What have you tried so far?

Google, FF documentation

Did you check FlutterFlow's Documentation for this topic?
No
5
4 replies