pickFromCamera static method

Future<File?> pickFromCamera()

Take a photo from the camera.

Returns the path of the saved image in a File object.

Implementation

static Future<File?> pickFromCamera() async {
  try {
    final photo = await _picker.pickImage(source: ImageSource.camera);
    if (photo != null) {
      return File(photo.path);
    }
  } catch (e) {
    Exception('خطاء اثناء اختيار صورة من الكاميرا: $e');
  }
  return null;
}