getPixels method

  1. @override
Future<PHImageDescriptor> getPixels(
  1. String id, {
  2. String? uri,
  3. required int maxSize,
})
override

Get photo description of the photo

id ID of the photo uri URI of the photo maxSize max size of result photo, if the photo has bigger size, it will be resized to the given size isPath

PHImageDescriptor image descriptor

Implementation

@override
Future<PHImageDescriptor> getPixels(
  String id, {
  String? uri,
  required int maxSize,
}) {
  assert(id.isNotEmpty || uri != null, "Id or uri must be provided");

  return _invokeMethod<PHImageDescriptor>(
    method: Functions.getPixels,
    arguments: {
      Arguments.id: id,
      Arguments.uri: uri,
      Arguments.maxSize: maxSize,
    },
    postProcess: (value) => PHImageDescriptor.fromCodecMessage(
      Map<String, dynamic>.from(value),
    ),
  );
}