fix: QR-Scan-Fehler sichtbar machen (Diagnose für "An unexpected error occurred")
mobile_scanners Default-errorBuilder zeigt nur die generische Meldung ohne Details. Eigener errorBuilder zeigt jetzt errorCode + errorDetails.message an, damit sich das reale Problem auf dem Tablet überhaupt einordnen lässt (z.B. Kamera-Berechtigung verweigert, Kamera nicht verfügbar, o.ä.). Zusätzlich Fallback-Button "Zurück – manuell eintragen". v0.1.6+7. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dzdm3EWeNdYFUuXFRJryA1
This commit is contained in:
1 parent
6f30e11e4e
commit
c5374efbd6
3 files changed
+36
-3
No files matched your search
@@ -1,3 +1,3 @@
|
|||||||
/// Manuell mit pubspec.yaml synchron halten (siehe timemaster-mobile,
|
/// Manuell mit pubspec.yaml synchron halten (siehe timemaster-mobile,
|
||||||
/// gleiche Konvention – kein package_info_plus während aktiver Feldtests).
|
/// gleiche Konvention – kein package_info_plus während aktiver Feldtests).
|
||||||
const String kAppVersion = '0.1.5+6';
|
const String kAppVersion = '0.1.6+7';
|
||||||
@@ -48,7 +48,40 @@ class _QrEnrollmentScanScreenState extends State<QrEnrollmentScanScreen> {
|
|||||||
appBar: AppBar(title: const Text('QR-Code scannen')),
|
appBar: AppBar(title: const Text('QR-Code scannen')),
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
MobileScanner(controller: _controller, onDetect: _onDetect),
|
MobileScanner(
|
||||||
|
controller: _controller,
|
||||||
|
onDetect: _onDetect,
|
||||||
|
errorBuilder: (context, error, child) {
|
||||||
|
// Default-errorBuilder zeigt nur "An unexpected error occurred"
|
||||||
|
// ohne Details – hier den echten MobileScannerErrorCode +
|
||||||
|
// Details anzeigen, damit sich das Problem auf dem Gerät
|
||||||
|
// überhaupt diagnostizieren lässt.
|
||||||
|
return Container(
|
||||||
|
color: Colors.black,
|
||||||
|
padding: const EdgeInsets.all(24),
|
||||||
|
child: Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.error_outline, color: Colors.red, size: 48),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
Text('Kamera-Fehler: ${error.errorCode}',
|
||||||
|
style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold)),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Text('${error.errorDetails?.message ?? "keine Details"}',
|
||||||
|
style: const TextStyle(color: Colors.white70, fontSize: 12),
|
||||||
|
textAlign: TextAlign.center),
|
||||||
|
const SizedBox(height: 24),
|
||||||
|
OutlinedButton(
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
child: const Text('Zurück – manuell eintragen', style: TextStyle(color: Colors.white)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
if (_error != null)
|
if (_error != null)
|
||||||
Positioned(
|
Positioned(
|
||||||
left: 16,
|
left: 16,
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
name: timemaster_kiosk
|
name: timemaster_kiosk
|
||||||
description: TimeMaster Kiosk – Stempeluhr für Android-Tablets hinter VPN
|
description: TimeMaster Kiosk – Stempeluhr für Android-Tablets hinter VPN
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
version: 0.1.5+6
|
version: 0.1.6+7
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.3.0 <4.0.0'
|
sdk: '>=3.3.0 <4.0.0'
|
||||||
|
|||||||
Reference in new issue
Block a user