fix: fall back to text input when mobile_scanner plugin is unavailable (#202) #219

Merged
guettlibot merged 1 commits from issue-202-fix into main 2026-05-24 12:55:09 +00:00
guettlibot commented 2026-05-24 12:48:20 +00:00 (Migrated from codeberg.org)

Summary

  • On some Android devices, mobile_scanner's native plugin is not registered, causing a MissingPluginException when the Send/Receive accounts screens try to open the QR camera.
  • Added _initScanner() to both AccountSendScreen and AccountReceiveScreen: it performs a pre-flight start+stop of a temporary MobileScannerController in a try/catch, catching any exception including MissingPluginException.
  • If the check fails, a _scannerFailed flag is set and the UI falls back to the existing copy-paste text-input flow; if it succeeds, a fresh controller is handed to the MobileScanner widget.
  • A loading spinner is shown during the brief initialisation check so the UI never shows a blank/stuck camera view.

Test plan

  • All 447 existing unit + widget tests pass
  • dart analyze reports no issues
  • On devices where the camera scanner works: brief spinner then camera opens normally
  • On devices where mobile_scanner is unavailable: spinner then text-paste fallback appears

Generated with Claude Code

## Summary - On some Android devices, mobile_scanner's native plugin is not registered, causing a MissingPluginException when the Send/Receive accounts screens try to open the QR camera. - Added _initScanner() to both AccountSendScreen and AccountReceiveScreen: it performs a pre-flight start+stop of a temporary MobileScannerController in a try/catch, catching any exception including MissingPluginException. - If the check fails, a _scannerFailed flag is set and the UI falls back to the existing copy-paste text-input flow; if it succeeds, a fresh controller is handed to the MobileScanner widget. - A loading spinner is shown during the brief initialisation check so the UI never shows a blank/stuck camera view. ## Test plan - [ ] All 447 existing unit + widget tests pass - [ ] dart analyze reports no issues - [ ] On devices where the camera scanner works: brief spinner then camera opens normally - [ ] On devices where mobile_scanner is unavailable: spinner then text-paste fallback appears Generated with Claude Code
Sign in to join this conversation.