mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 09:05:10 +00:00
Fix open file
This commit is contained in:
parent
100d485558
commit
d1ab79c0f9
1 changed files with 3 additions and 3 deletions
|
@ -9,9 +9,6 @@ import 'package:mime_type/mime_type.dart';
|
|||
|
||||
extension MatrixFileExtension on MatrixFile {
|
||||
void open() async {
|
||||
Directory tempDir = await getTemporaryDirectory();
|
||||
final file = File(tempDir.path + "/" + path.split("/").last);
|
||||
file.writeAsBytesSync(bytes);
|
||||
if (kIsWeb) {
|
||||
final fileName = path.split('/').last;
|
||||
final mimeType = mime(fileName);
|
||||
|
@ -27,6 +24,9 @@ extension MatrixFileExtension on MatrixFile {
|
|||
element.click();
|
||||
element.remove();
|
||||
} else {
|
||||
Directory tempDir = await getTemporaryDirectory();
|
||||
final file = File(tempDir.path + "/" + path.split("/").last);
|
||||
file.writeAsBytesSync(bytes);
|
||||
await OpenFile.open(file.path);
|
||||
}
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue