Firebase – How to show success message and catch error during flutter firestore data update
I have this function Future updateMember(Member member) async { final User? user = Auth().currentUser; final docMember = FirebaseFirestore.instance.collection('users').doc(user?.uid); member.id = docMember.id; final json = member.toJson(); final response = await docMember .update(json) .then((value) => {print("done")}) .catchError((e) => (e)); return response; }…