dummyCallNativeCode method

  1. @protected
Future dummyCallNativeCode(
  1. String method,
  2. Map<String, dynamic> data,
  3. Future<ImageFile> callback()
)

Implementation

@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 HcImageFileExtension.decode(result);
    }

    return null;
  } on MissingPluginException catch (_) {
    return await callback();
  }
}