|
@@ -16,11 +16,32 @@ class _QRViewExampleState extends State<QRViewExample> {
|
|
|
Barcode? result;
|
|
|
QRViewController? controller;
|
|
|
final GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
|
|
|
-
|
|
|
+ CameraFacing _cameraFacing = CameraFacing.front;
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
return Scaffold(
|
|
|
- appBar: VAppBar(titleText: "扫一扫"),
|
|
|
+ appBar: VAppBar(
|
|
|
+ titleText: "扫一扫",
|
|
|
+ actions: [
|
|
|
+ // IconButton(
|
|
|
+ // onPressed: () {
|
|
|
+ // setState(() {
|
|
|
+ // _cameraFacing = _cameraFacing == CameraFacing.back
|
|
|
+ // ? CameraFacing.front
|
|
|
+ // : CameraFacing.back;
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // icon: Icon(
|
|
|
+ // Icons.change_circle_outlined,
|
|
|
+ // color: Colors.white,
|
|
|
+ // size: 36,
|
|
|
+ // ),
|
|
|
+ // ),
|
|
|
+ // SizedBox(
|
|
|
+ // width: 8,
|
|
|
+ // ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
body: Column(
|
|
|
children: <Widget>[
|
|
|
Expanded(
|
|
@@ -54,6 +75,7 @@ class _QRViewExampleState extends State<QRViewExample> {
|
|
|
: 300.0;
|
|
|
return QRView(
|
|
|
key: qrKey,
|
|
|
+ cameraFacing: _cameraFacing,
|
|
|
onQRViewCreated: _onQRViewCreated,
|
|
|
overlay: QrScannerOverlayShape(
|
|
|
borderColor: Theme.of(context).colorScheme.primary,
|