syncDir function
Recursively copies the contents from the first directory to another, and then in the same way but on the reverse.
If isCopyFile is false, so copies only tree directorias without file.
Function filter takes the file path and returned bool type.
Implementation
Stream<FileLog> syncDir(
Directory dir1,
Directory dir2, {
bool isCopyFile = true,
bool Function(String)? filter,
}) async* {
yield* copyDirRec(
dir1,
dir2,
isCopyFile: isCopyFile,
filter: filter,
);
yield* copyDirRec(
dir2,
dir1,
isCopyFile: isCopyFile,
filter: filter,
);
}