callback static method

void callback({
  1. required dynamic onProgressUpdate(
    1. String?,
    2. int
    ),
})

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);
  });
}