chore: Follow up file download type fix

This commit is contained in:
Krille 2023-04-19 15:51:53 +02:00
parent 3b130b6d00
commit 6a3c729a64
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/material.dart';
@ -22,6 +24,7 @@ extension LocalizedBody on Event {
void shareFile(BuildContext context) async {
final matrixFile = await _getFile(context);
inspect(matrixFile);
matrixFile.result?.share(context);
}

View file

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