nc-photos/lib/web/file_saver.dart

18 lines
430 B
Dart
Raw Normal View History

2021-09-09 22:42:47 +02:00
// ignore: avoid_web_libraries_in_flutter
import 'dart:html' as html;
// ignore: avoid_web_libraries_in_flutter
import 'dart:js' as js;
import 'dart:typed_data';
import 'package:nc_photos/platform/file_saver.dart' as itf;
class FileSaver extends itf.FileSaver {
@override
saveFile(String filename, Uint8List content) async {
js.context.callMethod("webSaveAs", [
html.Blob([content]),
filename,
]);
}
}