flutter_firebase_chat_core icon indicating copy to clipboard operation
flutter_firebase_chat_core copied to clipboard

createGroupRoom with specific metadata

Open superaldo opened this issue 2 years ago • 1 comments
trafficstars

Hello 👋

Maybe it's a bug or I'm not doing something right. when I create a room with metadata it works fine the room is created and the data in the field "metadata" is complete in my "firestore", but when I try to access the data inside "metadata" it throws me null or empty. here is my code for create a room:

final room = await FirebaseChatCore.instance.createGroupRoom(
      name: nameRoom,
      users: otherUser,
      metadata: {
        'typeProcess': typeProcess,
        'algo': algo,
        'pen': pen,
        'endProcess': false,
      },
    );

and when I try to access the data inside "metadata" in my chat screen, it throws null, empty or 0.

print(widget.room.metadata.length) //output 0

superaldo avatar Aug 23 '23 12:08 superaldo

Hello!

Maybe

`print(widget.room.metadata.length) //output 0` 

is a saved room instance that will not update? If the data is on Firestore, you should be able to easily read that, after it is fetched.

demchenkoalex avatar Aug 26 '23 14:08 demchenkoalex