nc-photos/app/lib/web/file_saver.dart
2022-04-06 02:37:58 +08:00

17 lines
430 B
Dart

// 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,
]);
}
}