InputMediaAnimation.fromFile constructor

InputMediaAnimation.fromFile({
  1. required File media,
  2. String? thumbnail,
  3. String? caption,
  4. String? parseMode,
  5. List<MessageEntity>? captionEntities,
  6. int? width,
  7. int? height,
  8. int? duration,
  9. bool? hasSpoiler,
})

Implementation

factory InputMediaAnimation.fromFile(
        {required io.File media,
        String? thumbnail,
        String? caption,
        String? parseMode,
        List<MessageEntity>? captionEntities,
        int? width,
        int? height,
        int? duration,
        bool? hasSpoiler}) =>
    InputMediaAnimation(
      media: 'attach://${media.path}',
      thumbnail: thumbnail,
      caption: caption,
      parseMode: parseMode,
      captionEntities: captionEntities,
      width: width,
      height: height,
      duration: duration,
      hasSpoiler: hasSpoiler,
    )..mediaFile = MultipartFile(
        media.path, media.openRead(), media.lengthSync(),
        filename: media.path.split('/').last);