sync method
Returns 'bool' on syncing the Directory's files with Cached Directory
Implementation
Future<bool?> sync() async {
try {
const kSyncWithExternalFilesDirectory = "syncWithExternalFilesDirectory";
const kSourceTreeUriString = "sourceTreeUriString";
const kCacheDirectoryName = "cacheDirectoryName";
var cacheDirectoryName = makeDirectoryPathToName(_directory);
final args = <String, dynamic>{
kSourceTreeUriString: _uriString,
kCacheDirectoryName: cacheDirectoryName,
};
final isSync = await kDocumentFileChannel.invokeMethod<bool?>(
kSyncWithExternalFilesDirectory, args);
if (isSync == null) return null;
return isSync;
} catch (e) {
return null;
}
}