Skip to content

feat: share and import meals via QR code#326

Open
jordan-lee-code wants to merge 12 commits intosimonoppowa:developfrom
jordan-lee-code:feature/share-meal-qr
Open

feat: share and import meals via QR code#326
jordan-lee-code wants to merge 12 commits intosimonoppowa:developfrom
jordan-lee-code:feature/share-meal-qr

Conversation

@jordan-lee-code
Copy link
Copy Markdown

@jordan-lee-code jordan-lee-code commented Apr 27, 2026

feat: share and import meals via QR code

Adds two new options to the meal section popup menu (Breakfast, Lunch, Dinner, Snack) on the Home and
Diary pages.

Share meal — encodes all food items in a meal into a compact QR code (gzip + base64url compressed)
displayed in a dialog, with copy-to-clipboard and native share sheet buttons.

Import shared meal — opens the camera to scan a shared QR code, shows a confirmation dialog listing the
number of items to be imported, then adds them to the selected meal. A "paste code" fallback (keyboard
icon in the app bar) is available for devices without camera access.

Image thumbnails for food items are preserved in the shared payload where available.

Changes:

  • New payload model with compact array format to minimise QR code size
  • New ShareMealQrDialog widget
  • New ImportMealScannerScreen with paste code fallback
  • Localised into all 6 supported languages (en, de, cz, it, tr, uk)
  • Added qr_flutter and share_plus dependencies

Addition to ... menu to allow sharing of meals with friends and family.
image

Generate QR code for easy sharing, you can copy the code and send it, or use the share menu.
image

Once import a shared meal is clicked you can scan the QR code and import the item
image

If the camera is unavailable, you can import using a code
image

You can paste the code and import the meal

image

You then get the same import x items prompt, click 'ok' and it'll import into the selected meal.

image

Closes #81

  Adds two new options to the meal section popup menu:
  - 'Share meal' — encodes all items in a meal as a compact gzip+base64 QR code, with copy and native share sheet options
  - 'Import shared meal' — opens the camera to scan a shared QR code and imports the items; includes a 'paste code' fallback for devices without a camera

  Supported on Android, iOS and all existing locales (en, de, cz, it, tr, uk).
@jordan-lee-code jordan-lee-code changed the title Feature/share meal qr feat: share and import meals via QR code Apr 27, 2026
  OFF items are stored as 3-field barcode refs [barcode, amount, unit]
  and resolved live from OpenFoodFacts on import; custom/FDC items carry
  full nutritional arrays. Cuts payload size significantly for typical
  OFF-heavy diaries. Adopted as clean v1 format (feature not yet merged).
  OFF lookups are parallelised via Future.wait. Partial-import failures
  surface a per-locale snackbar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant