ScheduledFileMessageCreateParams.withFileBytes constructor

ScheduledFileMessageCreateParams.withFileBytes(
  1. Uint8List fileBytes,
  2. {required int scheduledAt,
  3. String? fileName,
  4. String? customType,
  5. String? data,
  6. MentionType mentionType = MentionType.users,
  7. List<MessageMetaArray>? metaArrays,
  8. AppleCriticalAlertOptions? appleCriticalAlertOptions,
  9. PushNotificationDeliveryOption pushNotificationDeliveryOption = PushNotificationDeliveryOption.normal}
)

withFileBytes

Implementation

ScheduledFileMessageCreateParams.withFileBytes(
  Uint8List fileBytes, {
  required this.scheduledAt,
  this.fileName,
  this.customType,
  this.data,
  this.mentionType = MentionType.users,
  this.metaArrays,
  this.appleCriticalAlertOptions,
  this.pushNotificationDeliveryOption = PushNotificationDeliveryOption.normal,
}) {
  String? fileMimeType = lookupMimeType('', headerBytes: fileBytes);
  if (fileMimeType != null) {
    mimeType = fileMimeType;
  } else if (mimeType == null) {
    sbLog.w(StackTrace.current, 'Unknown file mimeType');
  }

  fileInfo = FileInfo.fromFileBytes(
    fileBytes: fileBytes,
    fileName: fileName ?? 'file',
    mimeType: mimeType,
  );
}