pickSingleImage static method

Future<FileData?> pickSingleImage({
  1. UImageSource source = UImageSource.gallery,
  2. bool selfie = false,
  3. int? imageQuality,
  4. UCropOptions? crop,
  5. UCameraOptions? cameraOptions,
  6. dynamic action(
    1. FileData?
    )?,
})

Implementation

static Future<FileData?> pickSingleImage({
  UImageSource source = UImageSource.gallery,
  bool selfie = false,
  int? imageQuality,
  UCropOptions? crop,
  UCameraOptions? cameraOptions,
  Function(FileData?)? action,
}) async {
  final List<FileData> files = await pickImage(source: source, selfie: selfie, imageQuality: imageQuality, crop: crop, cameraOptions: cameraOptions);
  final FileData? file = files.isEmpty ? null : files.first;
  action?.call(file);
  return file;
}