universal_html icon indicating copy to clipboard operation
universal_html copied to clipboard

Get Flutter Web Directory

Open softplaceio opened this issue 1 year ago • 0 comments

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.

softplaceio avatar Apr 14 '23 15:04 softplaceio