pickSingleImage static method

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

Implementation

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