swapUser method

void swapUser({
  1. required int index,
})

Function to swap AgoraUser in the floating layout.

Implementation

void swapUser({required int index}) {
  final AgoraUser newUser = value.users[index];
  final AgoraUser tempAgoraUser = value.mainAgoraUser;
  value = value.copyWith(mainAgoraUser: newUser);
  _addUser(callUser: tempAgoraUser);
  _removeUser(uid: newUser.uid);
}