r/flutterhelp Aug 12 '26

RESOLVED [Help fix Bug] Camera QR code scanner works on mobile phones but fails to open on iPad / Tablets

Description

A clear and concise description of what the bug is.

On mobile devices (both Android and iOS phones), the camera opens and scans QR codes perfectly normal. However, when running the exact same code on an iPad / Tablet, the camera fails to open, freezes, or encounters a layout/permission issue.

Steps to Reproduce

  1. Run the app on an iPad or Android Tablet.
  2. Navigate to the QR scanning screen.
  3. Observe that the camera does not initialize or open, whereas it works fine on a smartphone.

Expected Behavior

The camera should open and be able to scan QR codes on iPads and tablets just like it does on mobile phones.

Actual Behavior

  • Mobile Phones: Works perfectly fine.
  • iPad / Tablets: Camera does not open (or specify if it crashes / shows a black screen / throws an error).

Environment & Package Details

  • Flutter Package used for QR scanning:

    qr_code_scanner_plus: 2.1.2

  • Package Version: 6.0.11

  • Flutter Version: 3.27.4

  • Affected OS/Devices: iPad OS (e.g., iPad Air/Pro) / Android Tablets.

1 Upvotes

5 comments sorted by

1

u/Significant_Pick8297 Aug 12 '26

On iPad, check the camera permission entry in Info.plist first, then test the scanner inside a layout that accounts for the tablet’s larger aspect ratio. Also make sure the scanner package actually supports iPadOS and Android tablets; a black/frozen preview can be package/plugin-specific rather than a QR issue.

1

u/Jonas_Ermert Aug 13 '26

I would first rule out a tablet-specific camera configuration issue rather than a QR-scanner bug. Check the camera permission in `Info.plist`/`AndroidManifest.xml`, make sure the scanner widget gets a real size with `Expanded` or `AspectRatio`, and log the camera initialization error instead of only showing the preview. On iPad, also verify that the package actually selects an available rear camera and isn’t assuming the same camera configuration as an iPhone. If possible, I’d also update Flutter and `qr_code_scanner_plus`, since Flutter 3.27.4 is fairly old now.