import 'dart:io'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:qr_code_scanner/qr_code_scanner.dart'; import '../Notifiers/scanLoginProvider.dart'; import '../Utils/app_colors.dart'; import '../Utils/commonWidgets.dart'; class Scannerlogin extends StatefulWidget { const Scannerlogin({super.key}); @override State createState() => _ScannerloginState(); } class _ScannerloginState extends State { @override Widget build(BuildContext context) { return Consumer( builder: (context, provider, child) { return WillPopScope( onWillPop: () => onBackPressed(context), child: SafeArea( top: false, bottom: Platform.isIOS?false:true, child: Scaffold( resizeToAvoidBottomInset: true, backgroundColor: AppColors.scaffold_bg_color, appBar: appbar(context, "QR Login"), body: Container( decoration: BoxDecoration(color: Colors.black), child: Column( children: [ Spacer(), Container( height: 250, child: QRView( key: provider.scannerKey, onQRViewCreated: (p0) { provider.onQRViewCreated(p0, context); }, formatsAllowed: [BarcodeFormat.qrcode], cameraFacing: CameraFacing.back, overlay: QrScannerOverlayShape( borderColor: AppColors.app_blue, borderRadius: 20, borderLength: 60, borderWidth: 10, cutOutSize: 250.0, ), ), ), SizedBox(height: 25), Text( "Scan QR", textAlign: TextAlign.center, style: TextStyle(fontSize: 18, color: Colors.white), ), Text( "to Login", textAlign: TextAlign.center, style: TextStyle(fontSize: 14, color: Colors.white), ), Spacer(), SizedBox(height: 50), ], ), ), ), ), ); }, ); } }