updateDownloadStatus method
Changes Download Status from 'Ready to Download' to 'Downloaded' when user downloads the file in local system
Implementation
Future<void> updateDownloadStatus(String id) async {
try {
print('update status:::::');
final downloadIdInt = int.tryParse(id);
if (downloadIdInt == null) {
debugPrint('Invalid downloadId string format: $id');
return;
}
await apiService.postData(
AppUrls.setDownloadStatus,
queryParams: {'downloadId': downloadIdInt},
);
} catch (e) {
debugPrint('Unable to update status for selected file: $e');
}
}