dint-dev / universal_html

Cross-platform 'dart:html'.
https://pub.dev/packages/universal_html
Apache License 2.0
201 stars 60 forks source link

Get Flutter Web Directory #71

Open softplaceio opened 1 year ago

softplaceio commented 1 year ago

Hello, How do I treat this message? I can't access the Flutter Web directory to save an archiv

import 'package:universal_html/html.dart' as html;

if (kIsWeb) {
  try {
    html.FileSystem fileSystem = await html.window.requestFileSystem(500, persistent: false);
    await fileSystem.root?.createFile("file.txt").then((value) => null);
    debugPrint("Ok");
  } on Exception {
    debugPrint("Err");
  }
} else {
 ....
}

Debug Console 4 Attempting to install properties from non-Object type 'FileSystem' onto the native JS Object. 3 Attempting to install properties from non-Object type 'DirectoryEntry' onto the native JS Object.