sendFiles function

Future<void> sendFiles(
  1. List<XFile> files,
  2. TUIChatSeparateViewModel model,
  3. V2TimConversation conversation,
  4. ConvType conversationType,
  5. BuildContext context,
)

Implementation

Future<void> sendFiles(
    List<XFile> files,
    TUIChatSeparateViewModel model,
    V2TimConversation conversation,
    ConvType conversationType,
    BuildContext context) async {
  for (final file in files) {
    final fileName = file.name;
    final filePath = file.path;
    await MessageUtils.handleMessageError(
        model.sendFileMessage(
            fileName: fileName,
            filePath: filePath,
            convID: _getConvID(conversation),
            convType: conversationType),
        context);
    await Future.delayed(const Duration(microseconds: 300));
  }
}