nc-photos/lib/web/file_saver.dart
2021-09-11 16:03:15 +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,
]);
}
}