From a99fed7fa2049e4a8b9d30da0e33d2ac50cd096f Mon Sep 17 00:00:00 2001 From: Crondung <1922635@stud.hs-mannheim.de> Date: Mon, 6 Mar 2023 15:22:02 +0100 Subject: [PATCH] add scanfield --- lib/widgets/scanner.dart | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/widgets/scanner.dart b/lib/widgets/scanner.dart index a4740b5..a30f1e1 100644 --- a/lib/widgets/scanner.dart +++ b/lib/widgets/scanner.dart @@ -59,12 +59,24 @@ class MyScanner extends StatelessWidget { return settingsProvider.scanning ? Expanded( - child: MobileScanner( + child: Stack( + alignment: Alignment.center, + children: [ + MobileScanner( fit: BoxFit.contain, controller: MobileScannerController( detectionTimeoutMs: 2000, ), - onDetect: onDetect)) + onDetect: onDetect, + ), + ClipRRect( + borderRadius: BorderRadius.circular(20), + child: Container( + height: MediaQuery.of(context).size.height / 3, + width: MediaQuery.of(context).size.width * 0.8, + color: Colors.white.withOpacity(0.4))), + ], + )) : RoundButton( onPressed: () => settingsProvider.scanning = true, iconData: Icons.qr_code_scanner_outlined,