mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-23 14:02:34 +01:00
16 lines
436 B
Dart
16 lines
436 B
Dart
import 'dart:io';
|
|
|
|
import 'package:famedlysdk/famedlysdk.dart';
|
|
import 'package:open_file/open_file.dart';
|
|
import 'package:path_provider/path_provider.dart';
|
|
|
|
extension MatrixFileExtension on MatrixFile {
|
|
void open() async {
|
|
Directory tempDir = await getTemporaryDirectory();
|
|
final file = File(tempDir.path + "/" + path.split("/").last);
|
|
file.writeAsBytesSync(bytes);
|
|
await OpenFile.open(file.path);
|
|
return;
|
|
}
|
|
}
|