fileExtension property

  1. @override
String get fileExtension

Used to save the file on the storage, includes a dot. For example '.jpeg'

Implementation

@override
String get fileExtension {
  var fileExtension = '';
  final contentTypeHeader =
      _response.headers[Headers.contentTypeHeader]?.first;
  if (contentTypeHeader != null) {
    final contentType = ContentType.parse(contentTypeHeader);
    fileExtension = mimeTypes[contentType.mimeType]!;
  }
  return fileExtension;
}