getImage static method

Future<Uint8List?> getImage({
  1. required ImageUri imageUri,
  2. ImageDimension dimension = ImageDimension.medium,
})

Gets an image from a specified imageUri

The size of the image can be controlled via the dimension. If no dimension is given the default value of ImageDimension.medium will be used Throws a PlatformException if adding failed Throws a MissingPluginException if the method is not implemented on the native platforms.

Implementation

static Future<Uint8List?> getImage(
    {required ImageUri imageUri,
    ImageDimension dimension = ImageDimension.medium}) async {
  try {
    return _channel.invokeMethod(MethodNames.getImage, {
      ParamNames.imageUri: imageUri.raw,
      ParamNames.imageDimension: dimension.value
    });
  } on Exception catch (e) {
    _logException(MethodNames.getImage, e);
    rethrow;
  }
}