Search code examples
flutterwebflutter-web

How do I retrieve all files in a directory on Flutter web?


On Flutter mobile I would write something like this

final filesDir = Directory(path);
final List<FileSystemEntity> entities =
        await filesDir.list(recursive: true).toList();

It doesn't work on the web since dart.io is not available. Is it possible to do something similar on the web?


Solution

  • I solved the problem by adding files to app assets.