Reputation: 153
i am using stream sdk for my chat application. i am trying to add additional properties to further describe my user, however, there isn’t any documentation on how i could achieve that. any ideas? tia
“There are additional properties you can provide to further describe your users.” from https://getstream.io/chat/docs/flutter-dart/update_users/?language=dart
Upvotes: 0
Views: 245
Reputation: 153
ive managed to retrieve the data with this
user?.extraData['designation'] as String
hope this will help anyone along the way
Upvotes: 0
Reputation: 600
You can add custom properties to user using the extraData
property of the User
class.
extradata
is a Map<String, Object?>
Example:
final user = User(id: "john", extraData: {
"name": "John Doe",
"custom_property": 10,
});
client.updateUser(User); //to update the user in the backend
Upvotes: 0