What you are going to learn: How to implement a call-back function to get back data from the delegate class in three steps.
To read the latest version of this article click here: https://mibcoder.com
Step: 1- Take function as a parameter
void downloadProgress({Function(int) callback}) {............................}
Step: 2- Set data to function, the data which have to send back from the delegate class
if(callback!=null)callback(progress);
Step: 3- Pass function in parameters from calling class.
dataProcessor.downloadProgress(callback: (int progress) {
print('download progress : $progress');
});