skip to Main Content

Get value from list of objects Firebase Android Studio

I have the following code: public void signOn(String id, String password){ usersReference.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { boolean valid = false; for(DataSnapshot singleSnapshot : dataSnapshot.getChildren()){ String key = singleSnapshot.getKey(); if (key.equals(id)) { singleSnapshot.getValue()//THIS LINE THIS LINE Intent…

VIEW QUESTION

Get the data from sub collection after filtering the field of collection using where clause and provide it to stream builder – Flutter

This is the code I tried Stream<QuerySnapshot> _usersStream = FirebaseFirestore.instance .collection("ChatRoom") .where("users", arrayContains: Constant.myname) .snapshots(); @override Widget ChatMessageList() { return StreamBuilder( // stream: chatMessageStream, stream: _usersStream, builder: (context, AsyncSnapshot<QuerySnapshot> snapshot) { if (snapshot.data == null) { return Center( child: CircularProgressIndicator(…

VIEW QUESTION
Back To Top
Search