Capture a Photo as Document Evidence Using the Device Camera
Within the File Upload Screen, the user can choose the camera option to open the device camera through Flutter's image_picker integration. The app requests camera permissions if not already granted. After capturing the photo, the image is validated for size (max 10 MB), and if valid, uploaded to the Supabase Storage bucket under the {org_id}/{activity_id}/{filename} path. The Document Storage Service triggers a thumbnail generation Edge Function so only a lightweight thumbnail is loaded in the document list view rather than the full-resolution image.
User Story
Acceptance Criteria
- Given the user opens the file upload screen, when they tap the camera option, then the device camera is launched via image_picker
- Given the device camera permission has not been granted, when the camera option is tapped, then a permission request dialog appears and the camera opens only after the user grants permission
- Given the user captures a photo, when the image file size exceeds 10 MB, then the upload is rejected with a clear error message before any upload attempt
- Given the user captures a valid photo, when the upload completes, then a thumbnail is generated server-side via the Edge Function and stored separately from the full-resolution file
- Given the photo upload is in progress, when the upload screen is visible, then an upload progress indicator is shown to the user
- Given the upload completes successfully, when the user is returned to the activity summary screen, then the new image thumbnail appears in the document attach widget
Business Value
Peer mentors are typically on the move after activities and need to capture physical documentation (printed invitations, posters) immediately. Camera capture within the app removes friction and increases the likelihood that evidence is attached at the point of activity rather than forgotten later.
Components
- File Upload Screen ui
- Document Storage Service service
- Activity Document Repository data
- File Storage Backend infrastructure