Root cause: the previous _initScanner() pre-flight called ctrl.start() without first calling ctrl.attach(), so MobileScannerController always timed out after 500 ms with a controllerNotAttached error — the scanner never worked on any device
Fix: replace with a targeted invokeMethod('state') probe on the scanner method channel; MissingPluginException (the exact error in the crash report) is caught and falls back to text input, while all other errors let the MobileScanner widget handle them via its own error builder
Tests: add three new widget tests for AccountReceiveScreen step-2 flow — text-fallback visible on non-camera platforms, successful import via text input, and friendly error display for invalid QR codes
Test plan
flutter analyze — no issues
flutter test test/unit/ test/widget/ — 450 tests pass (8 tests in account_export_screen_test.dart including the 3 new step-2 cases)
On Android with a working scanner: camera view should now appear (scanner was previously always replaced by text fallback due to the broken pre-flight)
On Android without the scanner plugin: text fallback shown, no crash
## Summary
- **Root cause**: the previous `_initScanner()` pre-flight called `ctrl.start()` without first calling `ctrl.attach()`, so `MobileScannerController` always timed out after 500 ms with a `controllerNotAttached` error — the scanner never worked on any device
- **Fix**: replace with a targeted `invokeMethod('state')` probe on the scanner method channel; `MissingPluginException` (the exact error in the crash report) is caught and falls back to text input, while all other errors let the `MobileScanner` widget handle them via its own error builder
- **Tests**: add three new widget tests for `AccountReceiveScreen` step-2 flow — text-fallback visible on non-camera platforms, successful import via text input, and friendly error display for invalid QR codes
## Test plan
- [ ] `flutter analyze` — no issues
- [ ] `flutter test test/unit/ test/widget/` — 450 tests pass (8 tests in `account_export_screen_test.dart` including the 3 new step-2 cases)
- [ ] On Android with a working scanner: camera view should now appear (scanner was previously always replaced by text fallback due to the broken pre-flight)
- [ ] On Android without the scanner plugin: text fallback shown, no crash
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
_initScanner()pre-flight calledctrl.start()without first callingctrl.attach(), soMobileScannerControlleralways timed out after 500 ms with acontrollerNotAttachederror — the scanner never worked on any deviceinvokeMethod('state')probe on the scanner method channel;MissingPluginException(the exact error in the crash report) is caught and falls back to text input, while all other errors let theMobileScannerwidget handle them via its own error builderAccountReceiveScreenstep-2 flow — text-fallback visible on non-camera platforms, successful import via text input, and friendly error display for invalid QR codesTest plan
flutter analyze— no issuesflutter test test/unit/ test/widget/— 450 tests pass (8 tests inaccount_export_screen_test.dartincluding the 3 new step-2 cases)🤖 Generated with Claude Code