I'm working on a FlutterFlow project where I need to execute some custom code whenever a Firestore collection is updated. In pure Flutter, I would typically use a StreamBuilder
or Firestore snapshots, and then run my callback logic whenever a new snapshot comes in. However, FlutterFlow's approach is more declarative and I don't see a direct way to run custom Dart callbacks upon data updates. Is there a recommended approach or a workaround to achieve callback-like functionality within the FlutterFlow environment, such as using custom widgets, custom functions, or another pattern?
How to implement callback-like functionality for Firestore updates in FlutterFlow?
Database & APIs
I have used the Firestore Query widgets to automatically refresh the UI on data changes, but I couldn't attach a "callback" or action directly to these data changes.
I consider using a Custom Widget with a StreamBuilder
that listens to Firestore snapshots, and then somehow triggering an action in FlutterFlow from this widget. However, I'm not sure how to pass these updates or trigger FlutterFlow actions directly from a Custom Widget.
Yes