swapUser method Null safety

Future<void> swapUser(
  1. {required int index}
)

Function to swap AgoraUser in the floating layout.

Implementation

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