FileResponse constructor

FileResponse(
  1. File file, {
  2. ContentDisposition disposition = ContentDisposition.inline,
  3. String? contentType,
})

Implementation

FileResponse(
  this.file, {
  ContentDisposition disposition = ContentDisposition.inline,
  String? contentType,
}) : super(
        file.openRead(),
        file.lengthSync(),
        fileName: p.basename(file.path),
        disposition: disposition,
        contentType:
            Mime.fromExtension(p.extension(file.path)) ?? Mime.octetStream,
      );