recursive method
Implementation
Future<void> recursive({
required FutureOr<void> Function(FileSystemEntity fileSystemEntity) onData,
}) async {
List<FileSystemEntity> fileSystemEntitys = listSync();
for (var i = 0; i < fileSystemEntitys.length; i++) {
FileSystemEntity fileSystemEntity = fileSystemEntitys[i];
await onData(fileSystemEntity);
if (fileSystemEntity is Directory) {
if ((await fileSystemEntity.exists())) {
await fileSystemEntity.recursive(onData: onData);
}
} else if (fileSystemEntity is File) {}
}
}