diff --git a/lib/network/images.dart b/lib/network/images.dart index b361813..8953c61 100644 --- a/lib/network/images.dart +++ b/lib/network/images.dart @@ -181,7 +181,15 @@ abstract class ImageDownloader { } if (configs['onResponse'] is JSInvokable) { - buffer = (configs['onResponse'] as JSInvokable)([Uint8List.fromList(buffer)]); + dynamic result = (configs['onResponse'] as JSInvokable)([Uint8List.fromList(buffer)]); + if (result is Future) { + result = await result; + } + if (result is List) { + buffer = result; + } else { + throw "Error: Invalid onResponse result."; + } (configs['onResponse'] as JSInvokable).free(); }