IoSentryAttachment.fromFile constructor

IoSentryAttachment.fromFile(
  1. File file, {
  2. String? filename,
  3. String? attachmentType,
  4. String? contentType,
})

Creates an attachment from a given File. Only available on dart:io platforms. Not available on web.

Implementation

IoSentryAttachment.fromFile(
  File file, {
  String? filename,
  String? attachmentType,
  String? contentType,
}) : super.fromLoader(
        loader: () => file.readAsBytes(),
        filename: filename ?? file.uri.pathSegments.last,
        attachmentType: attachmentType,
        contentType: contentType,
      );