callback static method
You can get the progress with onProgressUpdate
.
On iOS, cannot get imageId.
Implementation
static void callback({required Function(String?, int) onProgressUpdate}) {
_channel.setMethodCallHandler((MethodCall call) {
if (call.method == 'onProgressUpdate') {
final id = call.arguments['image_id'] as String?;
final progress = call.arguments['progress'] as int;
onProgressUpdate(id, progress);
}
return Future.value(null);
});
}