chore: Follow up file download type fix

This commit is contained in:
Krille 2023-04-19 15:51:53 +02:00
parent 99595caee5
commit 9bed679568
No known key found for this signature in database
2 changed files with 5 additions and 2 deletions

View File

@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -22,6 +24,7 @@ extension LocalizedBody on Event {
void shareFile(BuildContext context) async { void shareFile(BuildContext context) async {
final matrixFile = await _getFile(context); final matrixFile = await _getFile(context);
inspect(matrixFile);
matrixFile.result?.share(context); matrixFile.result?.share(context);
} }

View File

@ -73,7 +73,7 @@ extension MatrixFileExtension on MatrixFile {
href: html.Url.createObjectUrlFromBlob( href: html.Url.createObjectUrlFromBlob(
html.Blob( html.Blob(
[bytes], [bytes],
'application/octet-stream', mimeType,
), ),
), ),
) )
@ -87,7 +87,7 @@ extension MatrixFileExtension on MatrixFile {
final box = context.findRenderObject() as RenderBox?; final box = context.findRenderObject() as RenderBox?;
await Share.shareXFiles( await Share.shareXFiles(
[XFile.fromData(bytes)], [XFile.fromData(bytes, name: name, mimeType: mimeType)],
sharePositionOrigin: sharePositionOrigin:
box == null ? null : box.localToGlobal(Offset.zero) & box.size, box == null ? null : box.localToGlobal(Offset.zero) & box.size,
); );