web_unique.dart 802 B

12345678910111213141516171819202122232425262728293031
  1. import 'dart:async';
  2. import 'dart:convert';
  3. import 'dart:js' as js;
  4. Future<void> webselectFiles({required bool is_folder}) async {
  5. return Future(
  6. () => js.context.callMethod('setByName', ['select_files', is_folder]));
  7. }
  8. Future<void> webSendLocalFiles(
  9. {required int handleIndex,
  10. required int actId,
  11. required String path,
  12. required String to,
  13. required int fileNum,
  14. required bool includeHidden,
  15. required bool isRemote}) {
  16. return Future(() => js.context.callMethod('setByName', [
  17. 'send_local_files',
  18. jsonEncode({
  19. 'id': actId,
  20. 'handle_index': handleIndex,
  21. 'path': path,
  22. 'to': to,
  23. 'file_num': fileNum,
  24. 'include_hidden': includeHidden,
  25. 'is_remote': isRemote,
  26. })
  27. ]));
  28. }