|
@protected |
|
Future dummyCallNativeCode( |
|
String method, |
|
Map<String, dynamic> data, |
|
Future<ic.ImageFile> Function() callback, |
|
) async { |
|
try { |
|
// Invoke will work only on Web, otherwise it will execute callback |
|
final result = await _channel.invokeMethod(method, data); |
|
if (result is Map) { |
|
return ImageFileExtension.decode(result); |
|
} |
|
|
|
return null; |
|
} on MissingPluginException catch (_) { |
|
return await callback(); |
|
} |
|
} |
This method should not return null. It currently returns null if result is not a Map, but none of the other places that use this method expect null and will unexpectedly throw if they receive null.
Here is a list of all the places that call dummyCallNativeCode but do not handle receiving null:
|
return await dummyCallNativeCode( |
|
return await dummyCallNativeCode( |
|
return await dummyCallNativeCode( |
|
return await dummyCallNativeCode( |
|
return await dummyCallNativeCode( |
image_compression_flutter/lib/src/interface.dart
Lines 13 to 30 in fb9880f
This method should not return
null. It currently returnsnullifresultis not aMap, but none of the other places that use this method expectnulland will unexpectedly throw if they receivenull.Here is a list of all the places that call
dummyCallNativeCodebut do not handle receiving null:image_compression_flutter/lib/src/compressor_io.dart
Line 18 in fb9880f
image_compression_flutter/lib/src/compressor_io.dart
Line 36 in fb9880f
image_compression_flutter/lib/src/compressor_io.dart
Line 54 in fb9880f
image_compression_flutter/lib/src/compressor_io.dart
Line 74 in fb9880f
image_compression_flutter/lib/src/interface.dart
Line 34 in fb9880f