skip to Main Content

Flutter – Function returns null

var result; void searching() async{ var searchData = await FirebaseFirestore.instance.collection('users').where('email',isEqualTo: userEmail).get(); setState(() { result = searchData.docs.first; }); } void addFollowing(var username , var email , var phoneNumber) async{ searching(); await FirebaseFirestore.instance.collection('users').doc(result).collection('following').doc().set({ 'username':username, 'email':email, 'phoneNumber':phoneNumber }); print(result); } I have two…

VIEW QUESTION
Back To Top
Search