getThumbnail method

  1. @override
Future<PHImageDescriptor> getThumbnail(
  1. int width,
  2. int height, {
  3. String? id,
  4. String? uri,
})
override

Get photo thumbnail for an photo item (only one of id/uri is used). Result thumbnail will have size of given width/height parameters

width expected width of result thumbnail height expected height of result thumbnail id ID of the photo uri URI of the photo

PHImageDescriptor thumbnail image descriptor

Implementation

@override
Future<PHImageDescriptor> getThumbnail(
  int width,
  int height, {
  String? id,
  String? uri,
}) {
  assert(id != null || uri != null, "Id or uri must be provided");

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