pickImage method

  1. @override
Future<Uint8List?> pickImage(
  1. ImageSource source,
  2. {ImagePickerConfig? config}
)
override

pickImage is the function that picks the image and returns it as a Uint8List. The function requires source, an ImageSource that's the method of how the image needs to be picked, for example gallery or camera.

Implementation

@override
Future<Uint8List?> pickImage(
  ImageSource source, {
  ImagePickerConfig? config,
}) async =>
    await (await (imagePicker ?? ImagePicker()).pickImage(
      source: source,
      maxWidth: config?.maxWidth,
      maxHeight: config?.maxHeight,
      imageQuality: config?.imageQuality,
    ))
        ?.readAsBytes();