Browse Source

safety

master
fmk 3 years ago
parent
commit
2deb30bbee
  1. 21
      lib/qr/qr_code_scan.dart

21
lib/qr/qr_code_scan.dart

@ -122,27 +122,28 @@ class _QrCodeScanPage extends State<QrCodeScanPage> {
}
}
startCameraResult(String data, List<Offset> offset) async {
void _startCameraResult(String data, List<Offset> offset) {
showData(data);
this.viewController.stopCamera();
}
Future onScan(QrReaderViewController viewController) async {
this.viewController = viewController;
await this.viewController.startCamera(startCameraResult);
await this.viewController.startCamera(_startCameraResult);
}
showData(String data) {
SmartDialog.show(
widget: Tips(
() {},
text: "$data",
),
onDismiss: () {
Future.delayed(Duration(seconds: 1), () {
this.viewController.startCamera(startCameraResult);
});
widget: Tips(
() {},
text: "$data",
),
onDismiss: () {
Future.delayed(Duration(seconds: 1), () {
this.viewController.startCamera(_startCameraResult);
});
},
);
}
@override

Loading…
Cancel
Save