We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3d8e7c commit e072384Copy full SHA for e072384
lib/helper/save_file_web.dart
@@ -0,0 +1,12 @@
1
+import 'dart:async';
2
+import 'dart:convert';
3
+import 'dart:html';
4
+
5
+///To save the excel sheet in the web platform.
6
+Future<void> saveAndLaunchFile(List<int> bytes, String fileName) async {
7
+ AnchorElement(
8
+ href:
9
+ 'data:application/octet-stream;charset=utf-16le;base64,${base64.encode(bytes)}')
10
+ ..setAttribute('download', fileName)
11
+ ..click();
12
+}
0 commit comments