If you want to know if a transaction on Firestore succeed? You can easily get a Stream of updates from your reference though, which would look something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 | DocumentReference documentReference; firestore.runTransaction( // firestore in this case is your Firestore instance (Transaction transaction) async { // whatever you do here with your reference await transaction.update( documentReference, ... ); documentReference.snapshots().listen((DocumentSnapshot event) { // here you could e.g. check if the transaction on your reference was succesful }); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.