pickMediaWithCrop static method

Future<String?> pickMediaWithCrop(
  1. BuildContext context,
  2. MediaSource source,
  3. MediaType type,
  4. MediaOptions options,
)

Pick media with interactive cropping UI if freeform cropping is enabled

Implementation

static Future<String?> pickMediaWithCrop(
  BuildContext context,
  MediaSource source,
  MediaType type,
  MediaOptions options,
) async {
  // Check if interactive cropping is needed
  if (options.cropOptions?.freeform == true &&
      options.cropOptions?.enableCrop == true) {
    return await _pickWithInteractiveCrop(context, source, type, options);
  }

  // Use regular picking for non-interactive cropping
  return await MediaPickerPlusPlatform.instance.pickMedia(source, type, options);
}