in example/lib/pages/qrcode/qrcode_page.dart [28:67]
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
// 扫码组件
MobileScanner(
controller: _scannerController,
fit: BoxFit.cover,
onDetect: _handleBarcodeDetection,
),
// 扫描框
Center(
child: Container(
width: 250,
height: 250,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 5),
borderRadius: BorderRadius.circular(10),
),
child: const Stack(
children: [
Align(
alignment: Alignment.center,
child: Text(
"Please put the QR code in the box",
style: TextStyle(
color: Colors.grey,
fontSize: 12,
fontWeight: FontWeight.bold,
),
),
),
],
),
),
),
],
),
);
}