sendChatroomVideoMessage method Null safety

Future<NIMResult<NIMChatroomMessage>> sendChatroomVideoMessage(
  1. {required String roomId,
  2. required String filePath,
  3. required int duration,
  4. required int width,
  5. required int height,
  6. String? displayName,
  7. NIMNosScene nosScene = NIMNosScenes.defaultIm,
  8. bool resend = false,
  9. ChatroomMessageAction? action}
)

Send a video message in the chatroom.

Implementation

Future<NIMResult<NIMChatroomMessage>> sendChatroomVideoMessage({
  required String roomId,
  required String filePath,
  required int duration,
  required int width,
  required int height,
  String? displayName,
  NIMNosScene nosScene = NIMNosScenes.defaultIm,
  bool resend = false,
  ChatroomMessageAction? action,
}) async {
  return _createMessage({
    'roomId': roomId,
    'filePath': filePath,
    'duration': duration,
    'width': width,
    'height': height,
    'displayName': displayName,
    'nosScene': nosScene,
    'messageType': 'video',
  }).then((messageResult) async {
    if (messageResult.isSuccess) {
      final message = messageResult.data as NIMChatroomMessage;
      await action?.call(message);
      return sendChatroomMessage(message, resend);
    } else {
      return messageResult;
    }
  });
}