how to load folders in flutter

100

List<FileSystemEntity> _folders;
Future<void> getDir() async {
  final directory = await getApplicationDocumentsDirectory();
  final dir = directory.path;
  String pdfDirectory = '$dir/';
  final myDir = new Directory(pdfDirectory);
  setState(() {
    _folders = myDir.listSync(recursive: true, followLinks: false);
  });
  print(_folders);
}

Comments

Submit
0 Comments