TeamService class Null safety

Constructors

TeamService()
factory

Properties

hashCode int
The hash code for this object.
read-only, inherited
onTeamListRemove Stream<List<NIMTeam>>
Listen to the removal of groups (including leaving a group, a group being disbanded, or being removed from a group.). Once the event occurs, a notification about it will be triggered. observer: The Observer interface, whose parameter is the list of members who are removed from their groups or leave voluntarily.
read-only
onTeamListUpdate Stream<List<NIMTeam>>
Listen to group profile changes (e.g., the creation of groups and group profile updates). Once the event occurs, a notification about group profile changes will be triggered. observer: The Observer interface, whose parameter is the list of updated group profiles
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

acceptInvite(String teamId, String inviter) Future<NIMResult<void>>
Accept other's invitation to join a group.
addManagers(String teamId, List<String> accounts) Future<NIMResult<List<NIMTeamMember>>>
Assign the admin role to group members. Only the group owner has permission for this operation. teamId: The group ID accounts: Accounts to be assigned with the admin role. Future: You can set the callback function. If the callback is invoked, the returned parameter is the list of new admins.
addMembersEx({required String teamId, required List<String> accounts, required String msg, required String customInfo}) Future<NIMResult<List<String>>>
Add group members and set a custom field. teamId: The group ID accounts: Accounts (accid) of the users to be added to the group. msg: The invitation's additional information. If the additional information is not required, leave the parameter empty. customInfo: The custom extension field. Leave the parameter empty if the custom extension field is not needed.
applyJoinTeam(String teamId, String postscript) Future<NIMResult<NIMTeam>>
Request to join the group. The ID of the group that the user applies for joining postscript: The additional information of the request InvocationFuture: You can set the callback function. Once the callback is invoked, the group profile will be returned.
createTeam({required NIMCreateTeamOptions createTeamOptions, required List<String> members}) Future<NIMResult<NIMCreateTeamResult>>
Create a group. You can call this API to create two types of groups (by passing different parameter values), that is, discussion groups and advanced groups. All message features are the same for the two types of groups. They differ in the management features: 1. all members of the discussion groups can add other users to their groups. 2. only the group owners of discussion groups can remove members, others cannot. Advanced groups have a comprehensive permission system and management features.
declineInvite(String teamId, String inviter, String reason) Future<NIMResult<void>>
Reject the invitation to join a group. teamId The group ID inviter The account(accid) of the inviter. reason The rejection reason (lengh limit: 5000 characters)
dismissTeam(String teamId) Future<NIMResult<void>>
Disband the group. Only the group owner has permission for this operation. You can set the callback function to listen to the operation results.
getMemberInvitor(String teamId, List<String> accids) Future<NIMResult<Map<String, String>>>
Get group members' inviters. teamId: The group ID accids: The group members' accid (up to 200 accid) The returned data is key-value pair (the key represents the group member's accid, the value represents the inviter's accid)
muteAllTeamMember(String teamId, bool mute) Future<NIMResult<void>>
Mute/unmute all normal group members. Only the group owner and group admins have the permission for this operation. teamId: The group ID mute: true-mute, false-unmute
muteTeam(String teamId, NIMTeamMessageNotifyTypeEnum notifyType) Future<NIMResult<void>>
Set the notification type for specified group messages. Multi-device synchronization is supported. notifyType: The enumeration of notification modes, incuding notifying group members of all group messages, only nofiying of messages sent by admins, and muting all group messages.
muteTeamMember(String teamId, String account, bool mute) Future<NIMResult<void>>
Mute or unmute group members.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
passApply(String teamId, String account) Future<NIMResult<void>>
Approve the request to join the group. Only the group owner and group admins have the permission for this operation.
queryMemberList(String teamId) Future<NIMResult<List<NIMTeamMember>>>
Get the group member list of a specified group.
It might takes time to get the group member information because the API might synchronize the latest data from the server. teamId: The group ID You can set the callback function. If the callback is invoked, the group member list will be returned.
queryMutedTeamMembers(String teamId) Future<NIMResult<List<NIMTeamMember>>>
Search the muted group members. Calling this API only returns users muted through the TeamService#muteTeamMember(String, String, boolean) method. teamId: The group ID. The group member list.
queryTeam(String teamId) Future<NIMResult<NIMTeam>>
Get a group profile. If no group file exists in the local database, the SDK will query the group file from the CommsEase IM server. If the current user is not in the group, the API might return an obsolete profile. If you need to get the latest profile, call {@link #searchTeam(String)}. teamId The group ID
queryTeamList() Future<NIMResult<List<NIMTeam>>>
Get all groups from the local database. Get the groups that the current user has joined. You can set the callback function. Once the callback is invoked, the list of groups that the current user has joined will be returned.
queryTeamMember(String teamId, String account) Future<NIMResult<NIMTeamMember>>
Query the group member's profile. The SDK will get the latest group member profile from the server when the data in the local database is obsolete. account Group member's account (accid)
quitTeam(String teamId) Future<NIMResult<void>>
Leave a group. teamId: The group ID
removeManagers(String teamId, List<String> managers) Future<NIMResult<List<NIMTeamMember>>>
Unassign the admin role from group members. Only the group owner has permission for this operation. teamId: The group ID managers: Accounts whose admin role need to be unassigned You can set the callback function. If the callback is invoked, the returned parameter is the list of members whose admin role has been unassigned.
removeMembers(String teamId, List<String> members) Future<NIMResult<void>>
Remove a group member. Only the group owner has the permission for the operation.
searchTeam(String teamId) Future<NIMResult<NIMTeam>>
Query the group profile from the CommsEase IM server. The group ID
searchTeamIdByName(String name) Future<NIMResult<List<String>>>
Query group IDs by group name. name: The group name. Returns the group ID list.
searchTeamsByKeyword(String keyword) Future<NIMResult<List<NIMTeam>>>
Users can search groups by keyword on the client. Query group IDs by group name. name: The group name. Returns the group list.
toString() String
A string representation of this object.
inherited
transferTeam(String teamId, String account, bool quit) Future<NIMResult<List<NIMTeamMember>>>
Transfer the group ownership to another user, who becomes the new group owner afterward. The former group owner became a normal member. If the quit parameter is set to true, the former group owner automatically leaves the group after the transfer. InvocationFuture You can set the callback function. If the callback is invoked, the quit parameter's value determines the returned parameters. If the quit parameter is false, the returned parameters only include the former group owner and the current group owner. If the quit parameter is true, the returned parameter is empty.
updateMemberNick(String teamId, String account, String nick) Future<NIMResult<void>>
Modify a member's nickname. Only the group owner and the group admins have permission for this operation. teamId The group ID account The account of the group member whose nickname needs to be modified nick The new nickname
updateMyMemberExtension(String teamId, Map<String, Object> extension) Future<NIMResult<void>>
Modify the current user's custom attribute as a group member teamId: The group ID extension: The new extension field (custom attribute)
updateTeamFields(String teamId, NIMTeamUpdateFieldRequest request) Future<NIMResult<void>>
Batch update multiple attributes of a group. teamId: The group ID request: The attributes that need to be updated and the corresponding values.

Operators

operator ==(Object other) bool
The equality operator.
inherited